#ifdef WIN32 # include <io.h> #else # include <unistd.h> #endif int access(const char *pathname, int mode); // check user permissions for a file
int mode values:
00 - Existence Only, 02 - For Write Only, 04 - For Read Only, 06 - Read and Write.
The function returns 0 if the file has the specified mode.
source share