• Advertisement

Archived

This topic is now archived and is closed to further replies.

Displaying files in the directory

This topic is 6518 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi there. I am currently working on a simple project and was wondering, how do you make your program display all available files in a specified directory using C? Is there some kind of function that does it? Thanks to all.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
There sure is (at least in most C distributions). Check your dir.h or dirent.h file. It may be in the sys subdirectory.

Look for functions named:
DIR *opendir(char *dirname);
struct dirent *readdir(DIR *dir);

Share this post


Link to post
Share on other sites

  • Advertisement