Node:Reading Attributes, Next:Testing File Type, Previous:Attribute Meanings, Up:File Attributes
To examine the attributes of files, use the functions stat,
fstat and lstat.  They return the attribute information in
a struct stat object.  All three functions are declared in the
header file sys/stat.h.
| int stat (const char *filename, struct stat *buf) | Function | 
| The statfunction returns information about the attributes of the
file named by filename in the structure pointed to by buf.If filename is the name of a symbolic link, the attributes you get
describe the file that the link points to.  If the link points to a
nonexistent file name, then  The return value is  
 When the sources are compiled with  | 
| int stat64 (const char *filename, struct stat64 *buf) | Function | 
| This function is similar to statbut it is also able to work on
files larger then 2^31 bytes on 32-bit systems.  To be able to do
this the result is stored in a variable of typestruct stat64to
which buf must point.When the sources are compiled with  | 
| int fstat (int filedes, struct stat *buf) | Function | 
| The fstatfunction is likestat, except that it takes an
open file descriptor as an argument instead of a file name. 
See Low-Level I/O.Like  
 When the sources are compiled with  | 
| int fstat64 (int filedes, struct stat64 *buf) | Function | 
| This function is similar to fstatbut is able to work on large
files on 32-bit platforms.  For large files the file descriptor
filedes should be obtained byopen64orcreat64. 
The buf pointer points to a variable of typestruct stat64which is able to represent the larger values.When the sources are compiled with  | 
| int lstat (const char *filename, struct stat *buf) | Function | 
| The lstatfunction is likestat, except that it does not
follow symbolic links.  If filename is the name of a symbolic
link,lstatreturns information about the link itself; otherwiselstatworks likestat.  See Symbolic Links.When the sources are compiled with  | 
| int lstat64 (const char *filename, struct stat64 *buf) | Function | 
| This function is similar to lstatbut it is also able to work on
files larger then 2^31 bytes on 32-bit systems.  To be able to do
this the result is stored in a variable of typestruct stat64to
which buf must point.When the sources are compiled with  |