access(2) - SerenityOS man pages


access - check if a file is accessible


#include <unistd.h>

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


Check if a file at the given path exists and is accessible to the current user for the given mode. Valid flags for mode are:

Return value

If the file is indeed accessible for the specified mode, access() returns 0. Otherwise, it returns -1 and sets errno to describe the error.