hello
how to check file permission using php ? I know php chmod() can set right permission
but how to know current permission of a file ?
Thank you!
| SitePoint Sponsor |


hello
how to check file permission using php ? I know php chmod() can set right permission
but how to know current permission of a file ?
Thank you!
I am not sure about getting file permission. So i also curious to know about it if any function or way in PHP.
Since you can add/set new permission to file/directory according to your requirements, why do you wanna get/know file permission?


infact I am using is_writeable , but as is seems there is no php command to know permission for a file.
http://uk3.php.net/manual/en/function.fileperms.php
fileperms
(PHP 4, PHP 5)
fileperms — Gets file permissions
Description
int fileperms ( string $filename )
Gets permissions for the given file.
Parameters
filename
Path to the file.
Return Values
Returns the permissions on the file, or FALSE in case of an error.
Hope this helps
Andrew


ok thank you!
Bookmarks