int stat(const char *pathname, struct stat *buf);
int fstat(int fd, struct stat *buf);
- Return value:
- On success, zero is returned. On error, -1 is returned.
- fd is not a valid open file.
- A directory component in pathname does not exist or the
path is an empty string.
- A component of the path is not a directory.
- pathnameptr is an invalid pointer value.
- No access to the file or the path of the file.
- pathname was too long.
- The call was interrupted by the user.