#include <sys/types.h> #include <dirent.h> int readdir( DIR *dirp );
The readdir()
function returns a pointer to a structure dirent
representing the next directory entry from the directory stream pointed to
by dirp
. On end-of-file, NULL is returned.
The readdir()
function may (or may not) return entries for . or .. Your
program should tolerate reading dot and dot-dot but not require them.
The data pointed to be readdir()
may be overwritten by another call to
readdir()
for the same directory stream. It will not be overwritten by
a call for another directory.
If ptr
is not a pointer returned by malloc()
, calloc()
, or
realloc()
or has been deallocated with free()
or
realloc()
, the results are not portable and are probably disastrous.
The routine is implemented in Cygnus newlib.
Copyright © 1988-2008 OAR Corporation