list all in directory

Q&A's, tips, howto's
Locked
dexter
Posts: 74
Joined: Fri Nov 11, 2011 12:55 am

list all in directory

Post by 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
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Re: list all in directory

Post by HPW »

Hans-Peter

dexter
Posts: 74
Joined: Fri Nov 11, 2011 12:55 am

Re: list all in directory

Post by dexter »

No ...
I think i's not

dexter
Posts: 74
Joined: Fri Nov 11, 2011 12:55 am

Re: list all in directory

Post by dexter »

as far as I can see the way is

(exec "find . -type -f")

I just want do it in newlisp way

bairui
Posts: 64
Joined: Sun May 06, 2012 2:04 am
Location: China
Contact:

Re: list all in directory

Post by bairui »

This is shown in CodePatterns under Walking A Directory Tree in section 5.

cormullion
Posts: 2038
Joined: Tue Nov 29, 2005 8:28 pm
Location: latiitude 50N longitude 3W
Contact:

Re: list all in directory

Post by cormullion »


dexter
Posts: 74
Joined: Fri Nov 11, 2011 12:55 am

Re: list all in directory

Post by dexter »

Thanks guys

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

anyway thanks

dexter
Posts: 74
Joined: Fri Nov 11, 2011 12:55 am

Re: list all in directory

Post by dexter »

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
Posts: 64
Joined: Sun May 06, 2012 2:04 am
Location: China
Contact:

Re: list all in directory

Post by bairui »

Use the (copy ) function on the string.

Code: Select all

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

Locked