PHP fileperms() Function

The fileperms() function returns the permissions for a file or directory.This function returns the permission as a number on success or FALSE on failure.

int fileperms ( string $filename )

Gets permissions for the given file.

Example -

The above example will output:

1777
0644

Example -

The above example will output:

-rw-r--r--

ParameterDescription
filenameRequired. Specifies the file to check

Note -

The result of this function are cached. Use clearstatcache() to clear the cache.