The getdents() function attempts to read nbyte bytes from the directory associated with the file descriptor fildes and to format them
as file system independent directory entries in the buffer pointed to by buf. Since the file system independent directory entries are of variable lengths, in most cases the actual
number of bytes returned will be less than nbyte. The file system independent directory entry is specified by the dirent structure. See dirent(3HEAD).
On devices capable of seeking, getdents() starts at a position in the file given by the file pointer associated with fildes. Upon return from getdents(), the file pointer is incremented to point to the next directory entry.
|