DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

dirent(FP)


dirent -- filesystem-independent directory entry

Syntax

#include <sys/types.h>

#include <sys/dirent.h>

Description

Different file system types may have different directory entries. The dirent structure defines a filesystem-independent directory entry, which contains information common to directory entries in different file system types.

The dirent structure is defined below.

   struct    dirent {
                     ino_t          d_ino;
                     short          d_pad;
                     off_t          d_off;
                     unsigned short d_reclen;
                     char           d_name[1];
                     };
The d_ino is a number which is unique for each file in the file system. The field d_off is the offset of that directory entry in the actual file system directory. The field d_name is the beginning of the character array giving the name of the directory entry. This name is null terminated and may have at most MAXNAMLEN characters. This results in filesystem-independent directory entries that are variable length entities. The value of d_reclen is the record length of this entry. This length is defined to be the number of bytes between the current entry and the next one, so that it will always result in the next entry being on a long boundary.

Files

/usr/include/sys/dirent.h

Standards conformance

dirent is conformant with:

X/Open Portability Guide, Issue 3, 1989 .


© 2003 File Formats for Programming (FP)
SCO OpenServer Release 5.0.7 -- 11 February 2003