Opens a directory for reading.
#include <dirent.h> DIR *opendir ( const char *pathname);
(IN) Points to a path that either is relative to the current working directory or is an absolute pathname. The pathname cannot include any wildcard characters.
If successful, returns a pointer to a DIR structure.
Otherwise, returns NULL and sets errno to one of the following:
The opendir function calls the malloc function to allocate memory for a DIR structure. The closedir function frees the memory.
Information about the first file or directory matching the specified pathname is not placed in the DIR structure until after the first call to the readdir function.