Hi all,
I've got a problem, what function do i use to list the contents of all the directory tree (simular to "find")? Any other suggestions?
Thank you all
Hi all,
I've got a problem, what function do i use to list the contents of all the directory tree (simular to "find")? Any other suggestions?
Thank you all
There are several ways to list all conents recursively. The most common is probably:
ls -lR. It's usually helpful to redirect to a file:
ls -lR > ls-lR.txt
You can use the find command, although it may be slower:
find . -type f -print. Again, you might want to redirect to a file.
And then, some systems have a utility called tree installed. If you have it, it'll actually draw a very simple diagram for your directory tree...
Hope that helps.
I need to check file by file from starting from / directroy, internally in C, not using outside command(ls, find, etc.) Let's say right my own ls. Is ther any function to list the contents of the directory or smth?
Try the C library functions...
opendir(3C)
readdir(3C)
rewinddir(3C)
seekdir(3C)
closedir(3C)