SilverScreen Solid Modeler

access

access

Previous topic Next topic  

access

Previous topic Next topic JavaScript is required for the print function  

StandardCLibrary

 

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:

 

Value

Meaning

0

test for existence

1

test for read permission

2

test for write permission

3

test for read and write permission

 

 

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