Please provide the “test.txt” file permissions back:
<?php echo fileperms(“test.txt”); ?> |
The permissions for a file are returned by the fileperms() method.
Note: This function caches its output. To clear the cache, use clearstatcache().
fileperms(filename) |
Parameter |
Description |
filename |
Essential. gives the location of the file to be checked. |
Return Value: |
Permissions for the file as a number; if not granted, FALSE |
PHP Version: |
4.0+ |
Permissions are shown as an octal value:
<?php echo substr(sprintf(“%o”,fileperms(“test.txt”)),-4); ?> |