stat(FP) 6 January 1993 stat(FP) Name stat - data returned by stat system call Syntax #include <sys/stat.h> Description The sys/stat.h include file contains the definition for the structure returned by the stat and fstat functions. The structure is defined as: dev_t st_dev; /* ID of device containing */ /* a directory entry for this file */ ushort st_ino; /* Inode number */ ushort st_mode; /* File mode (see mknod (S)) */ short st_nlink; /* Number of links */ ushort st_uid; /* User ID of the file's owner */ ushort st_gid; /* Group ID of the file's group */ dev_t st_rdev; /* ID of device */ /* This entry is defined only for */ /* character special or */ /* block special files */ off_t st_size; /* File size in bytes */ time_t st_atime; /* Time of last access */ time_t st_mtime; /* Time of last data modification */ time_t st_ctime; /* Time of last file status change */ /* Times measured in seconds since */ /* 00:00:00 GMT, Jan. 1, 1970 */ The stmode value is actually a combination of one or more of the follow- ing file mode values: S_IFMT 0170000 /* type of file */ S_IFREG 0100000 /* regular */ S_IFBLK 0060000 /* block special */ S_IFNAM 0050000 /* special named file */ S_IFDIR 0040000 /* directory */ S_IFCHR 0020000 /* character special */ S_IFIFO 0010000 /* fifo */ The following definitions provide POSIX compliance of file permissions: S_IRWXU 00700 /* read, write, execute: owner */ S_IRUSR 00400 /* read permission: owner */ S_IREAD 00400 /* read permission, owner */ S_IWUSR 00200 /* write permission: owner */ S_IWRITE 00200 /* write permission, owner */ S_IXUSR 00100 /* execute permission: owner */ S_IEXEC 00100 /* execute/search permission, owner */ S_IRWXG 00070 /* read, write, execute: group */ S_IRGRP 00040 /* read permission: group */ S_IWGRP 00020 /* write permission: group */ S_IXGRP 00010 /* execute permission: group */ S_IRWXO 00007 /* read, write, execute: other */ S_IROTH 00004 /* read permission: other */ S_IWOTH 00002 /* write permission: other */ S_IXOTH 00001 /* execute permission: other */ S_ISUID 04000 /* set user id on execution */ S_ISGID 02000 /* set group id on execution */ S_ISVTX 01000 /* save swapped text even after use */ Files /usr/include/sys/stat.h See also stat(S) Standards conformance stat is conformant with: AT&T SVID Issue 2; X/Open Portability Guide, Issue 3, 1989; IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C Language] (ISO/IEC 9945-1); and NIST FIPS 151-1.