Skip to content

Instantly share code, notes, and snippets.

@shichao-an
Last active August 29, 2015 14:20
Show Gist options
  • Save shichao-an/e98f9a012d74b7a96293 to your computer and use it in GitHub Desktop.
Save shichao-an/e98f9a012d74b7a96293 to your computer and use it in GitHub Desktop.
#include <dirent.h>
DIR *opendir(const char *pathname);
DIR *fdopendir(int fd);
/* Both return: pointer if OK, NULL on error */
struct dirent *readdir(DIR *dp);
/* Returns: pointer if OK, NULL at end of directory or error */
void rewinddir(DIR *dp);
int closedir(DIR *dp);
/* Returns: 0 if OK, −1 on error */
long telldir(DIR *dp);
/* Returns: current location in directory associated with dp */
void seekdir(DIR *dp, long loc);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment