DIR

Holds information about a directory entry

Service:File and Directory

Structure

  #include <dirent.h>
  
  typedef struct dirent {
     uint32_t   d_userspec;
     uint32_t   d_flags;   
     mode_t     d_type;    
     mode_t     d_mode;
     ino_t      d_ino; 
     off64_t    d_size;   
     uint32_t   d_spare[55];
     uint8_t    d_pad1;
     uint8_t    d_pad2;
     uint8_t    d_pad3;
     uint8_t    d_namelen; 
     char       d_name[NAME_MAX+1];
  } DIR;
  

Fields

d_userspec

Provides a field for the caller; whatever the caller puts in this field is left untouched.

d_flags

Currently unused.

d_type

Specifies the type of entry. See Directory Entry Types.

d_mode

Specifies the file access mode. For a list of possible values, see File Access Modes and NetWare Attributes.

d_ino

Specifies the directory entry number assigned to the entry specified by the d_name field.

d_size

Specifies the entry's size, in bytes; used for files only.

d_spare

Currently unused.

d_pad1

Provides padding.

d_pad2

Provides padding.

d_pad3

Provides padding.

d_namelen

Specifies the length of the name in the d_name field.

d_name

Specifies the name of the entry.

Remarks

The POSIX specification defines only one field for this structure, the d_name field. This is the only portable field in the structure.