Directories are processed with the
closedir() functions. A
struct dirent contains the inode number and the file’s name. Maximally portable code uses only the filename in the
d_name member. The BSD
seekdir() functions for saving and restoring the current position in a directory are widely available but are not as fully portable as the other directory processing functions.
Share this highlighthttp://www.safaribooksonline.com/a/linux-programming-by/51316/