This section describes how to read directory entries from a directory stream, and how to close the stream when you are done with it. All the symbols are declared in the header file `dirent.h'.
Portability Note: On some systems, readdir
may not return entries for `.' and `..', even though these are always valid file names in any directory. See File Name Resolution.
If there are no more entries in the directory or an error is detected, readdir
returns a null pointer. The following errno
error conditions are defined for this function:
EBADF
0
on success and -1
on failure.
The following errno
error conditions are defined for this function:
EBADF