list all in directory

Started by dexter, January 13, 2013, 10:16:37 PM

Previous topic - Next topic

dexter

I just want a function ,to list all file include subdirs of a directory



It seems something to do with local vars?





and I searched in forum, but forum says my key words are too common to search



so anyone can help me ?



Thanks

HPW

#1
Maybe this:



http://newlispfanclub.alh.net/forum/viewtopic.php?f=5&t=112&p=586&hilit=filelist#p586">http://newlispfanclub.alh.net/forum/vie ... elist#p586">http://newlispfanclub.alh.net/forum/viewtopic.php?f=5&t=112&p=586&hilit=filelist#p586
Hans-Peter

dexter

#2
No ...

I think i's not

dexter

#3
as far as I can see  the way is



(exec "find . -type -f")



I just want do it in newlisp way

bairui

#4
This is shown in http://www.newlisp.org/downloads/CodePatterns.html">CodePatterns under Walking A Directory Tree in section 5.

cormullion

#5
See also https://en.wikibooks.org/wiki/Introduction_to_newLISP/Working_with_files">//https://en.wikibooks.org/wiki/Introduction_to_newLISP/Working_with_files.

dexter

#6
Thanks guys



It's weired and failed , when I did not use (append)  to do this iter



anyway thanks

dexter

#7
BTW



is there a function

replace a string in a string ,but never change the orginal string ?



newlisp's replace is just edit the orginal string

bairui

#8
Use the (copy ) function on the string.


(replace "hello" (copy x) "goodbye")