stat, fstat \- get file status
.B #include <sys/types.h>
obtains detailed information about a named file.
obtains the same information about an open file
known by the file descriptor from a successful
points to a null-terminated string naming
is the address of a buffer
into which information is placed concerning the file.
It is unnecessary to have any
permissions at all with respect to the file, but all directories
leading to the file must be searchable.
The layout of the structure pointed to by buf
is encoded according to the `#define' statements.
.so /usr/include/sys/stat.h
The mode bits 0000070 and 0000007 encode group and
name various width integer values;
major and minor device numbers;
their exact definitions are in
the include file <sys/types.h>
is associated with a pipe,
reports an ordinary file with an i-node number,
and a not necessarily meaningful length.
is the file was last read.
For reasons of efficiency, it is not set when a directory
is searched, although this would be more logical.
is the time the file was last written or created.
It is not set by changes of owner, group, link count, or mode.
is set both both by writing and changing the i-node.
Zero is returned if a status is available;
\-1 if the file cannot be found.