File status

File status information resides in the i-node.

The stat subroutines are used to return information on a file. The stat subroutines report file type, file owner, access mode, file size, number of links, i-node number, and file access times. These subroutines write information into a data structure designated by the Buffer variable. The process must have search permission for the directories in the path to the designated file.

Subroutine Description
stat Subroutine that returns the information about files named by the Path parameter. If the size of the file cannot be represented in the structure designated by the Buffer variable, stat will fail with the errno set to EOVERFLOW.
lstat Subroutine that provides information about a symbolic link, and the stat subroutine returns information about the file referenced by the link.
fstat Returns information from an open file using the file descriptor.

The statfs, fstafs, and ustat subroutines return status information about a file system.

Subroutine Description
fstatfs Returns the information about the file system that contains the file associated with the given file descriptor. The structure of the returned information is described in the /usr/include/sys/statfs.h file for the statfs and fstatfs subroutines and in the ustat.h file for the ustat subroutine.
statfs Returns information about the file system that contains the file specified by the Path parameter.
ustat Returns information about a mounted file system designated by the Device variable. This device identifier is for any given file and can be determined by examining the st_dev field of the stat structure defined in the /usr/include/sys/stat.h file. The ustat subroutine is superseded by the statfs and fstatfs subroutines.
utimes and utime Also affect file status information by changing the file access and modification time in the i-node.