Hi, I am looking for a C program in Unix to browse the directory and list the files(recursively). Can somebody help me on this.
Thanks in advance.
Jaykar
Hi, I am looking for a C program in Unix to browse the directory and list the files(recursively). Can somebody help me on this.
Thanks in advance.
Jaykar
any good?Code:int main() { system("ls -Lr"); return 0; }
Seriously, you want to look at "opendir()" and "readdir()" and "closedir()". You'll probably need "stat" as well to get some of the data about the file, if you want to show more than the filename.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Or even just read the FAQ.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.