PHP fileperms() Function
Complete PHP Filesystem Reference Manual
Definition and Usage
The fileperms() function returns the permissions of a file or directory.
Returns the permissions as a number on success, or FALSE on failure.
Syntax
fileperms(filename)
| Parameters | Description |
|---|---|
| filename | Required. Specifies the file to check. |
Tips and Notes
**Note:** The results of this function are cached. Use clearstatcache() to clear the cache.
Example 1
The code above will output:
33206
Example 2
Display permissions as an octal value:
The code above will output:
1777
Complete PHP Filesystem Reference Manual