Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
readdir(3)
Edit
PageHistory
Diff
Info
LikePages
READDIR !!!READDIR NAME SYNOPSIS DESCRIPTION RETURN VALUE ERRORS CONFORMING TO BUGS SEE ALSO ---- !!NAME readdir - read a directory !!SYNOPSIS __#include __''dir''__); __ !!DESCRIPTION The __readdir()__ function returns a pointer to a dirent structure representing the next directory entry in the directory stream pointed to by ''dir''. It returns NULL on reaching the end-of-file or if an error occurred. The data returned by __readdir()__ is overwritten by subsequent calls to __readdir()__ for the same directory stream. The ''dirent'' structure is defined as follows: struct dirent { long d_ino; /* inode number */ off_t d_off; /* offset to the next dirent */ unsigned short d_reclen;/* length of this record */ unsigned char d_type; /* type of file */ char d_name[[256]; /* filename */ }; !!RETURN VALUE The __readdir()__ function returns a pointer to a dirent structure, or NULL if an error occurs or end-of-file is reached. !!ERRORS __EBADF__ Invalid directory stream descriptor ''dir''. !!CONFORMING TO SVID 3, POSIX, BSD 4.3 According to POSIX, the ''dirent'' structure contains a field ''char d_name[[]'' of unspecified size, with at most __NAME_MAX__ characters preceding the terminating null character. Use of other fields will harm the portability of your programs. !!BUGS Field ''d_type'' is not implemented as of libc6 2.1 and will always return DT_UNKNOWN (0). !!SEE ALSO read(2), opendir(3), closedir(3), rewinddir(3), seekdir(3), telldir(3), scandir(3) ----
19 pages link to
readdir(3)
:
fts_open(3)
Man3r
alphasort(3)
closedir(3)
fts(3)
fts_close(3)
fts_read(3)
fts_set(3)
glob(3)
globfree(3)
opendir(3)
rewinddir(3)
scandir(3)
seekdir(3)
telldir(3)
versionsort(3)
getdents(2)
readdir(2)
fts_children(3)
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.