OK. First things first. These functions are NOT part of the ANSI standard library. They may not be supported on your platform.
Here is a quick summary of each function, they are listed in the order in which you may want to execute them.
Library: dirent.h
Prototype: DIR *opendir(const char *name);
struct dirent *readdir(DIR *dir);
int scandir(const char *dir, struct dirent ***namelist,
int (*select)(const struct dirent *),
int (*compar)(const void *, const void *));
void seekdir(DIR *dir, off_t offset);
off_t telldir(DIR *dir);
void rewinddir(DIR *dir);
int closedir(DIR *dir);
|
struct dirent
{
long d_ino;
off_t d_off;
unsigned short d_reclen;
char d_name[NAME_MAX+1];
};
|
example program using opendir, readdir and closedir.
stat function.
opendir
readdir
scandir
seekdir
telldir
rewinddir
closedir
| Top | Master Index | Keywords | Functions |