#include <dirent.h> struct dirent *readdir(DIR *dir);
This function reads entries from a directory opened by opendir
(see section opendir). It returns the information in a static buffer with
this format:
struct dirent { unsigned short d_namlen; /* The length of the name (like strlen) */ char d_name[MAXNAMLEN+1]; /* The name */ };
Note that some directory entries might be skipped by readdir
,
depending on the bits set in the global variable
__opendir_flags
. See section opendir.
A pointer to a static buffer that is overwritten with each call.
not ANSI, POSIX (see note 1)
Notes:
__opendir_flags
variable is DJGPP-specific.
DIR *d = opendir("."); struct dirent *de; while (de = readdir(d)) puts(de->d_name); closedir(d);
Go to the first, previous, next, last section, table of contents.