Obtains information about an open file.
#include <sys/stat.h> int fstat ( int fildes, struct stat *buf);
(IN) Specifies a file handle.
(OUT) Points to the address of the structure stat.
If successful, returns 0. Otherwise, returns -1 and sets errno to one of the following:
The fstat function obtains information about an open file whose file descriptor is the fildes parameter. This information is placed in the structure located at the address indicated by the buf parameter.
The sys/stat.h header file contains definitions for the stat structure and describes the contents of the fields within that structure.