Hello.
I need a function that receives a path, an returns a list of the immediate files.
Is someone can help me?
Hello.
I need a function that receives a path, an returns a list of the immediate files.
Is someone can help me?
This is platform specific and you will probably have to write it yourself. Though you can search for third party functions that do what you want. What OS and compiler do you use?
-Prelude
My best code is written with the delete key.
I need it for two platforms:
1. NT-4 + VC5
2. gcc version 2.96 20000731 (Red Hat Linux 7.1 2.96-81)
Rami.
There are some standard c functions for doing this. Dirent.h contains the functions for doing this kind of stuff. Since I don't feel like writing code just look on google.
try something like this:
Something like that might work for you. But then again, it might not.Code:#include <stdio.h> #include <dirent.h> int main() { struct dirent *foo=NULL; DIR *bar=NULL; char ham[lengthoffilename][numberofentries]; char* filename="why/didnt/you/search/the/web"; bar=opendir(filename); /*this opens the dir-big surprise*/ /*check for NULL pointer here*/ while (foo == readdir(bar)){ /*set up a for loop here and read*/ ham[][i] = foo->d_name } closedir(bar); return 0; }
Turn no more aside and brood
Upon love's bitter mysteries
For Fergus rules the brazen cars...