The opendir() function opens a directory stream corresponding to the directory named by the dirname argument.
The fdopendir() function opens a directory stream for the directory file descriptor fildes. The directory file discriptor should not be used or closed following a successful function call, as this might cause undefined results from future operations on the
directory stream obtained from the call. Use closedir(3C) to close a directory stream.
The directory stream is positioned at the first entry. If the type DIR is implemented using a file descriptor, applications will only be able to open up to a total of {OPEN_MAX} files and directories. A successful call to any of the exec functions
will close any directory streams that are open in the calling process. See exec(2).
|