#include <unistd.h> int access(const char *filename, int flags);
This function determines what kind of access modes a given file allows.
The parameter flags is the logical or
of one or more of the
following flags:
R_OK
W_OK
X_OK
F_OK
D_OK
Zero if the requested access mode is allowed, nonzero if not.
not ANSI, POSIX
if (access("file.ext", W_OK)) return ERROR_CANNOT_WRITE; open("file.ext", O_RDWR);
Go to the first, previous, next, last section, table of contents.