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