HP-UX Reference (11i v1 00/12) - 5 Miscellaneous Topics, 7 Device (Special) Files, 9 General Information, Index (vol 9)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man5/!!!intro.5
________________________________________________________________
___ ___
s
stat(5) stat(5)
Implementations may OR other implementation-dependent bitsinto 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.
S_ISBLK(m) Test for a block special file.
S_ISCHR(m) Test for a character special file.
S_ISDIR(m) Test for a directory.
S_ISFIFO(m) Test for a pipe or FIFO special file.
S_ISREG(m) Test for a regular file.
S_ISLNK(m) Test for a symbolic link.
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);
APPLICATION USAGE
Use of the macros is recommended for determining the type of a file.
SEE ALSO
chmod(), fchmod(), fstat(), lstat(), mkdir(), mkfifo(), mknod(), stat(), umask(), <sys/types.h>.
CHANGE HISTORY
First released in Issue 1.
Derived from Issue 1 of the SVID.
Issue 4
The following changes are incorporated for alignment with the ISO POSIX-1 standard:
• The function declarations in this header are expanded to full ISO C prototypes.
• The DESCRIPTION section is expanded to indicate (a) how files are uniquely identified within the
system, (b) that times are given in units of seconds since the Epoch, (c) rules governing the
definition and use of the file mode bits, and (d) usage of the file type test macros.
Other changes are incorporated as follows:
• Reference to the header <sys/types.h> is added for the definitions of dev_t, ino_t, mode_t, nlink_t,
uid_t, gid_t, off_t, and time_t. This has been marked as an extension.
• References to the S_IREAD, S_IWRITE, S_IEXEC file and S_ISVTX modes are removed.
• The descriptions of the members of the stat structure in the DESCRIPTION section are
corrected.
Issue 4, Version 2
The following changes are incorporated for X/OPEN UNIX conformance:
• The st_blksize and st_blocks members are added to the stat structure.
• The S_IFLINK value of S_IFMT is defined.
• The S_ISVTX file mode bit and the S_ISLNK file type test macro is defined.
• The fchmod(), lstat(), and mknod() functions are added to the list of functions declared in
this header.
HP-UX Release 11i: December 2000 − 2 − Section 5−−343
___
___