Retrieves the status of the specified file or directory.
#include <sys/stat.h> int stat ( const char *path, struct stat *buf);
(IN) Points to a string containing the path of the directory or file for which status is to be obtained.
(OUT) Points to the structure containing information about the file.
If successful, returns 0. Otherwise, returns -1 and sets errno to one of the following:
The stat function returns information in the stat structure located at the address indicated by the buf parameter.
The caller must have permission to search all directories in the path parameter.
The sys/stat.h header file contains definitions for the stat structure and the fields are described in stat.