BSD 2 development
[unix-history] / misc / access.2
.th ACCESS II 10/1/78
.sh NAME
access \*- test file access permission
.sh SYNOPSIS
(access = 33.; not in assembler)
.br
.ft B
sys access; name; mode
.s3
access(name, mode)
.br
char *name;
.ft R
.sh DESCRIPTION
.it Name
points to a null-terminated string naming
a file;
.it mode
is an integer less than or equal to 7.
.it Access
tests to see if the real user id of the current
process has the specified access permissions on
the named file.
.s3
The desired access permissions for
.it mode
are constructed by adding 4 for read access, 2 for write
access, and 1 for execute access.
.sh "SEE ALSO"
chmod (II)
.sh DIAGNOSTICS
Error bit (c-bit)
is set if the file cannot be found or the permission is not granted.
From C, a \*-1 return indicates an error.