Synopsis

#include <unistd.h>

int access(const char *pathname, int mode);

Description

access() checks for file accessibility.

Arguments:
pathname - path to the file
mode - access permission to be checked.

Return value

access() returns the value 0 upon successful completion, otherwise the value -1 is returned.

Errors

If file does not exists ENOENT is returned.