DIR

Holds information about a directory entry

Service:File System
Defined In:dirent.h

Structure

   typedef struct dirent { 
      unsigned long    d_attr ; 
      unsigned short   d_time ;  
      unsigned short   d_date ;  
      long             d_size ; 
      ino_t            d_ino ;  
      dev_t            d_dev ;  
      unsigned long    d_cdatetime ;  
      unsigned long    d_adatetime ; 
      unsigned long    d_bdatetime ;   
      long             d_uid ;  
      unsigned long    d_archivedID ;   
      unsigned long    d_updatedID ;  
      char             d_nameDOS [13]; 
      unsigned short   d_inheritedRightsMask ;  
      unsigned char    d_originatingNameSpace ; 
      unsigned long    d_ddatetime ; 
      unsigned long    d_deletedID ; 
      char             d_name [255+1];  
   } DIR; 
   

Fields

d_attr

Specifies the attribute as defined in NWFATTR.H.

d_time

Specifies the modification time in DOS format.

d_date

Specifies the modification date in DOS format.

d_size

Specifies the size (files only).

d_ino

Specifies the serial number.

d_dev

Specifies the volume number.

d_cdatetime

Specifies the creation date and time in DOS format.

d_adatetime

Specifies the last access date (files only) in DOS format.

d_bdatetime

Specifies the last archive date and time in DOS format.

d_uid

Specifies the owner ID (object ID).

d_archivedID

Specifies the object ID that last archived the file.

d_updateID

Specifies the object ID that last updated the file.

d_nameDOS

Specifies the DOS name space name.

d_inheritedRightsMask

Specifies the inherited rights mask.

d_originatingNameSpace

Specifies the creating name space.

d_ddatetime

Specifies the date and time the entry was deleted (used by the ScanErasedFiles function only).

d_deletedID

Specifies the object ID that deleted the file (used by the ScanErasedFiles function only).

d_name

Specifies the name space name of the entry.

Remarks

The stack size might need to be increased (by using a link directive) when using the DIR structure especially in functions where the structure is used recursively such as: opendir, readdir, and ScanErasedFiles.

Date and time fields use standard DOS format as explained in the following graphic:

Figure 11-1 Date and Time Fields

Byte 0 consists    of the Day (bits 0-4) and the Month (bits 5-7). Byte 1 consists    of the Year (bits 0-7). Bytes 2 and 3 consist of the Seconds (bits    0-4), the Minute (bits 5-7 and 0-2), and the Hour (bits 3-7).

The year bits contain the number of years elasped since 1980. That value is added to 1980 and thus provides an accurate count to the year 2000 and beyond.

The seconds are calculated in 2-second intervals, so the value in the seconds bits must be multiplied by 2 to get the accurate number of seconds. For example a value of 15 means that 30 seconds have elapsed toward the next minute.

d_time uses bytes two and three.

d_date uses bytes 0 and 1.

d_cdatetime, d_adatetime, and d_bdatetime use all four bytes.