HP-UX Reference (11i v1 05/09) - 5 Miscellaneous Topics (vol 9)
d
dirent(5) dirent(5)
NAME
dirent.h - format of directory streams and directory entries
SYNOPSIS
#include <sys/types.h>
#include <dirent.h>
DESCRIPTION
This header file defines data types used by the directory stream routines described in directory(3C).
The following data types are defined:
DIR A structure containing information about an open directory stream.
struct dirent A structure defining the format of entries returned by the readdir function (see
directory(3C)).
The struct dirent structure includes the following members:
char d_name[MAXNAMLEN+1]; /* name of directory entry */
ino_t d_ino; /* file serial number */
short d_namlen; /* length of string in d_name */
short d_reclen; /* length of this record */
The constant
MAXNAMLEN is defined in <dirent.h>.
Note that the d_reclen entry is used internally to represent the offset from the current entry to the next
valid entry. Therefore, d_reclen is not the length of the current entry, but the length of the current record
where a record is an entry plus any currently unused space between the current entry and the next valid
entry. The unused space between valid dirent entries results from changes in a directory’s contents, such
as the deletion of files and other directories.
This file also contains external declarations for the functions in the directory(3C) package.
AUTHOR
dirent.h was developed by AT&T and HP.
SEE ALSO
directory(3C), ndir(5).
STANDARDS CONFORMANCE
<
dirent.h>: AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1
Section 5−−40 Hewlett-Packard Company − 1 − HP-UX 11i Version 1: September 2005