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>:

- test for read permission
- test for write permission
- test for execute or search permission
- 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.
Wed Sep 14 10:06:31 BST 1994