If you are using a POSIX operating system (UNIX, Linux, etc) you would use opendir() and readdir() to get the directory information. You need to include sys/types.h and dirent.h to use these functions. Here are the function prototypes:
Code:
DIR *opendir(const char *name);
struct dirent *readdir(DIR *dir);
Pry open the dirent.h header file for the details in the dirent structure (I'm not in front of a *nix system at the moment, and my memory is failing).
When you are finished with the directory, be sure to call closedir():
Code:
int closedir(DIR *dir);
Hope that helps.