# stat

## NAME



           stat - file status
    


## LIBRARY



           Standard C library (_libc_)
    


## SYNOPSIS



           **#include <sys/stat.h>**
    
           **struct stat {**
               **dev_t      st_dev;** /* ID of device containing file */
               **ino_t      st_ino;** /* Inode number */
               **mode_t     st_mode;** /* File type and mode */
               **nlink_t    st_nlink;** /* Number of hard links */
               **uid_t      st_uid;** /* User ID of owner */
               **gid_t      st_gid;** /* Group ID of owner */
               **dev_t      st_rdev;** /* Device ID (if special file) */
               **off_t      st_size;** /* Total size, in bytes */
               **blksize_t  st_blksize;** /* Block size for filesystem I/O */
               **blkcnt_t   st_blocks;** /* Number of 512 B blocks allocated */
    
               /* Since POSIX.1-2008, this structure supports nanosecond
                  precision for the following timestamp fields.
                  For the details before POSIX.1-2008, see VERSIONS. */
    
               **struct timespec  st_atim;** /* Time of last access */
               **struct timespec  st_mtim;** /* Time of last modification */
               **struct timespec  st_ctim;** /* Time of last status change */
    
           **#define st_atime  st_atim.tv_sec** /* Backward compatibility */
           **#define st_mtime  st_mtim.tv_sec**
           **#define st_ctime  st_ctim.tv_sec**
           **};**
    
       Feature Test Macro Requirements for glibc (see
       feature_test_macros(7)):
    
           _st_atim_ , _st_mtim_ , _st_ctim_ :
               Since glibc 2.12:
                   _POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700
               glibc 2.19 and earlier:
                   _BSD_SOURCE || _SVID_SOURCE
    


## DESCRIPTION



           Describes information about a file.
    
           The fields are as follows:
    
           _st_dev_ This field describes the device on which this file resides.
                  (The major(3) and minor(3) macros may be useful to
                  decompose the device ID in this field.)
    
           _st_ino_ This field contains the file's inode number.
    
           _st_mode_
                  This field contains the file type and mode.  See inode(7)
                  for further information.
    
           _st_nlink_
                  This field contains the number of hard links to the file.
    
           _st_uid_ This field contains the user ID of the owner of the file.
    
           _st_gid_ This field contains the ID of the group owner of the file.
    
           _st_rdev_
                  This field describes the device that this file (inode)
                  represents.
    
           _st_size_
                  This field gives the size of the file (if it is a regular
                  file or a symbolic link) in bytes.  The size of a symbolic
                  link is the length of the pathname it contains, without a
                  terminating null byte.
    
           _st_blksize_
                  This field gives the "preferred" block size for efficient
                  filesystem I/O.
    
           _st_blocks_
                  This field indicates the number of blocks allocated to the
                  file, in 512-byte units.  (This may be smaller than
                  _st_size_ /512 when the file has holes.)
    
           _st_atime_
                  This is the time of the last access of file data.
    
           _st_mtime_
                  This is the time of last modification of file data.
    
           _st_ctime_
                  This is the file's last status change timestamp (time of
                  last change to the inode).
    
           For further information on the above fields, see inode(7).
    


## STANDARDS



           POSIX.1-2008.
    


## NOTES



           The following header also provides this type: _< ftw.h>_.
    


* * *