newLISP Fan Club

Forum => newLISP in the real world => Topic started by: dexter on January 13, 2013, 10:16:37 PM

Title: list all in directory
Post by: dexter on January 13, 2013, 10:16:37 PM
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
Title: Re: list all in directory
Post by: HPW on January 13, 2013, 10:51:17 PM
Maybe this:



http://newlispfanclub.alh.net/forum/viewtopic.php?f=5&t=112&p=586&hilit=filelist#p586
Title: Re: list all in directory
Post by: dexter on January 13, 2013, 11:04:23 PM
No ...

I think i's not
Title: Re: list all in directory
Post by: dexter on January 13, 2013, 11:08:00 PM
as far as I can see  the way is



(exec "find . -type -f")



I just want do it in newlisp way
Title: Re: list all in directory
Post by: bairui on January 13, 2013, 11:48:18 PM
This is shown in CodePatterns (//http) under Walking A Directory Tree in section 5.
Title: Re: list all in directory
Post by: cormullion on January 13, 2013, 11:54:28 PM
See also //https://en.wikibooks.org/wiki/Introduction_to_newLISP/Working_with_files.
Title: Re: list all in directory
Post by: dexter on January 14, 2013, 12:00:51 AM
Thanks guys



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



anyway thanks
Title: Re: list all in directory
Post by: dexter on January 14, 2013, 12:06:49 AM
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
Title: Re: list all in directory
Post by: bairui on January 14, 2013, 12:13:40 AM
Use the (copy ) function on the string.


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