#include <unistd.h>
int access(path, mode) char *path; int mode;
path points to a path name naming a file. access() checks the named file for accessibility according to mode, which is an inclusive or of the following bits:
The following value may also be supplied for mode:
The real user ID and the supplementary group IDs (including the real group ID) are used in verifying permission, so this call is useful to set-UID programs.
Notice that only access bits are checked. A directory may be indicated as writable by access(), but an attempt to open it for writing will fail (although files may be created there); a file may look executable, but execve() will fail unless it is in proper format.
access() returns:
The file access permissions do not permit the requested access to the file named by path.
A pathname component is longer than {NAME_MAX} while {_POSIX_NO_TRUNC} is in effect (see pathconf.2v
In addtion to the above, the following may also occur:
Created by unroff & hp-tools. © somebody (See intro for details). All Rights Reserved. Last modified 11/5/97