BSD 2 development
[unix-history] / misc / access.2
CommitLineData
ddcb4516
BJ
1.th ACCESS II 10/1/78
2.sh NAME
3access \*- test file access permission
4.sh SYNOPSIS
5(access = 33.; not in assembler)
6.br
7.ft B
8sys access; name; mode
9.s3
10access(name, mode)
11.br
12char *name;
13.ft R
14.sh DESCRIPTION
15.it Name
16points to a null-terminated string naming
17a file;
18.it mode
19is an integer less than or equal to 7.
20.it Access
21tests to see if the real user id of the current
22process has the specified access permissions on
23the named file.
24.s3
25The desired access permissions for
26.it mode
27are constructed by adding 4 for read access, 2 for write
28access, and 1 for execute access.
29.sh "SEE ALSO"
30chmod (II)
31.sh DIAGNOSTICS
32Error bit (c-bit)
33is set if the file cannot be found or the permission is not granted.
34From C, a \*-1 return indicates an error.