Next: errno Up: File and Directory Manipulation Previous: Directory handling functions

File Manipulation Routines

int access(char *path, int mode) - determine accessibility of file.

path points to a path name naming a file. access() checks the named file for accessibility according to mode, defined in #include <unistd.h>:

R_OK
- test for read permission
W_OK
- test for write permission
X_OK
- test for execute or search permission
F_OK
- test whether the directories leading to the file can be searched and the file exists.

access() returns: 0 on success, -1 on failure and sets errno to indicate the error. See man pages for list of errors.


Dave.Marshall@cm.cf.ac.uk
Wed Sep 14 10:06:31 BST 1994