This section describes what you find in a single directory entry, as you might obtain it from a directory stream. All the symbols are declared in the header file `dirent.h'.
char d_name[]
ino_t d_fileno
d_ino
. In the GNU system and most POSIX
systems, for most files this the same as the st_ino
member that
stat
will return for the file. See section File Attributes.
unsigned char d_namlen
unsigned char
because that is the integer
type of the appropriate size
unsigned char d_type
DT_UNKNOWN
DT_REG
DT_DIR
DT_FIFO
DT_SOCK
DT_CHR
DT_BLK
_DIRENT_HAVE_D_TYPE
is defined if this member is available. On systems where it is used, it
corresponds to the file type bits in the st_mode
member of
struct statbuf
. If the value cannot be determine the member
value is DT_UNKNOWN. These two macros convert between d_type
values and st_mode
values:
d_type
value corresponding to mode.
st_mode
value corresponding to dtype.
This structure may contain additional members in the future. Their
availability is always announced in the compilation environment by a
macro names _DIRENT_HAVE_D_xxx
where xxx is replaced
by the name of the new member. For instance, the member d_reclen
available on some systems is announced through the macro
_DIRENT_HAVE_D_RECLEN
.
When a file has multiple names, each name has its own directory entry.
The only way you can tell that the directory entries belong to a
single file is that they have the same value for the d_fileno
field.
File attributes such as size, modification times etc., are part of the file itself, not of any particular directory entry. See section File Attributes.
Go to the first, previous, next, last section, table of contents.