|  | ||
| 
 | 
 int access ( char *filename, int mode ) 
 char *filename; // pathname of file or directory int mode; // permission mode 
 | 
 | ||||||||||
| Synopsis | #include "silver.h" 
 The access function determines if path exists and can be accessed in access mode mode . 
 | 
 | ||||||||||
| Parameters | filename is a null-terminated string specifying the name of the file or path. mode is a number specifying the access mode. The permissible values for mode are given by the following table: 
 
 
 | 
 | ||||||||||
| Return Value | If path refers to a file, then access returns 0 if the file exists and can be accessed in mode . If path refers to a directory, access returns 0 if the directory exists. If path does not exist or is cannot be accessed by the specified mode , then access returns -1. 
 | 
 | ||||||||||
| See Also | chdir , rmdir , rename , unlink 
 | 
 | ||||||||||
| 
 | 
 |