access
access(pathname, string)
This function returns 1 (True) if the file name specified by the expression pathname is accessible according to the mode given by the string string.
The pathname argument is either a file system path or an HTTP or HTTPS resource. For the latter, the function issues an HTTP HEAD request and uses the response to that request to determine if the resource can be accessed.
The string argument is either e (for exists), or a concatenation of one or more of the strings r (for “read”), w (for “write”), and x (for “executable”) based on system permissions for the file. For example:
if (access("doc.sgm", "rw"))
tests for both read and write permission to the file doc.sgm. If the file does not exist, or if it does not have each of the permissions specified, 0 is returned.