stat

Holds information about the status of a file or directory.

Service:File and Directory

Structure

  #include <sys/stat.h>
  
  struct stat
  {
     uint32_t     st_userspec;
     uint32_t     st_flags;
     mode_t       st_mode;
     uint32_t     st_spare1;
     uint64_t     st_gen;
     ino_t        st_ino; 
     dev_t        st_dev;
     dev_t        st_rdev;
     off64_t      st_size;
     uint64_t     st_spare2;
     blkcnt_t     st_blocks;
     blksize_t    st_blksize;
     nlink_t      st_nlink;
     uint32_t     st_spare3[3];
     uid_t        st_uid;
     gid_t        st_gid;
     uid_t        st_bid;
     uid_t        st_mid; 
     timespec_t   st_atime;
     timespec_t   st_mtime;
     timespec_t   st_ctime;
     timespec_t   st_btime;
     uint32_t     st_rights;
     uint32_t     st_spare4[3];
     char         st_name[255+1];
     uint32_t     st_spare5[20];
  }; 
  

Fields

st_userspec

Specifies a field untouched by the stat function.

st_flags

Specifies the open flags for the entry. See File Control Open Modes.

st_mode

Specifies the file mode (see File Access Modes and NetWare Attributes).

st_spare1

Reserved.

st_gen

Specifies the generation number of the inode. This number is not used by NetWare® file systems.

st_ino

Specifies the directory entry number.

st_dev

Specifies the volume number.

st_rdev

Specifies the device type (always 0).

st_size

Specifies the total file size in bytes (files only).

st_spare2

Reserved.

st_blocks

Specifies the count of blocks allocated to the file.

st_blksize

Specifies the block size for allocation (files only).

st_nlink

Specifies the count of hard links (always 1).

st_spare3[3]

Reserved.

st_uid

Specifies the object ID of the owner.

st_gid

Specifies the group ID (always 0).

st_bid

Specifies the ID of the object that last archived the entry.

st_mid

Specifies the ID of the object that last updated the entry.

st_atime

Specifies the last date the file was accessed (not used for directories). Time information (hours, minutes, and seconds) is not available from the file system.

st_mtime

Specifies the last time the entry was modified. Time is specified in seconds since the epoch.

st_ctime

Specifies when the attributes of the file last changed. Time is specified in seconds since the epoch.

st_btime

Specifies when the entry was last archived. Time is specified in seconds since the epoch.

st_rights

Specifies the caller's effective NetWare rights to the entry. For more information about this bit mask, see Effective Rights Flags. This field is returned, if requested, by the getstat and fgetstat functions. It is not returned by the stat or fstat functions.

st_spare4

Reserved. This field is not returned by stat or fstat.

st_name

Specifies the name of the entry. This is a null-terminated string. This field is returned, if requested, by the getstat and fgetstat functions. It is not returned by the stat or fstat functions.

st_spare5

Reserved. This field is not returned by stat or fstat.

Remarks

The time fields return the number of seconds since the epoch. On NetWare, the nanoseconds field in the structure is always set to 0.