United States-English |
|
|
HP-UX Reference > Sstat(5)HP-UX 11i Version 3: February 2007 |
|
NAMEstat: stat.h — data returned by the stat() function DESCRIPTIONThe <sys/stat.h> header defines the structure of the data returned by the functions fstat(), lstat(), and stat(). The structure stat contains at least the following members:
File serial number and device ID taken together uniquely identify the file within the system. The dev_t, ino_t, mode_t, nlink_t, uid_t, gid_t, off_t, time_t and blkcnt_t types are defined as described in <sys/types.h>. Times are given in seconds since the Epoch. The following symbolic names for the values of st_mode are also defined: File type
File mode bits: miscellaneous
File mode bits: permissions
File mode bits: obsolete permission names
The bits defined by S_IRUSR, S_IWUSR, S_IXUSR, S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_ISUID, S_ISGlD and S_ISVTX are unique. S_IRWXU is the bitwise OR of S_IRUSR, S_IWUSR, and S_IXUSR. S_IRWXG is the bitwise OR of S_IRGRP, S_IWGRP, and S_IXGRP. S_IRWXO is the bitwise OR of S_IROTH, S_IWOTH, and S_IXOTH. Implementations may OR other implementation-dependent bits into S_IRWXU, S_IRWXG, and S_IRWXO, but they will not overlap any of the other bits defined in this document. The file permission bits are defined to be those corresponding to the bitwise inclusive OR of S_IRWXU, S_IRWXG, and S_IRWXO. The following macros will test whether a file is of the specified type. The value m supplied to the macros is the value of st_mode from a stat structure. The macro evaluates to a non-zero value if the test is true, 0 if the test is false.
The following are declared as functions and may also be defined as macros: int chmod(const char *path, mode_t mode); int lstat(const char *path, struct stat *buf); int mkdir(const char *path, mode_t mode); int mkfifo(const char *path, mode_t mode); int mknod(const char *path, mode_t mode, dev_t dev); int stat(const char *path, struct stat *buf); mode_t umask(mode_t cmask); Use of the macros is recommended for determining the type of a file. WARNINGSFor 32-bit applications, st_ino will be truncated to its least significant 32-bits for file systems that use 64-bit values. SEE ALSOchmod(2), chown(2), link(2), mkdir(2), mknod(2), stat(2), symlink(2), umask(2), utime(2), mkfifo(3C), types(5). Issue 4The following changes are incorporated for alignment with the ISO POSIX-1 standard:
Other changes are incorporated as follows:
Issue 4, Version 2The following changes are incorporated for X/OPEN UNIX conformance:
|
Printable version | ||
|