how to get file permission in php getting files permission

RegisterLogin
how to get file permission in php getting files permission
Post Description: how to get file permission in php getting files permission
Tags: how, to, get, file, permission, in, php, getting, files, permission
This Post Was Posted On Feb 29, 2008 By web hosting #1324
today i wanted to know how i get a file's permission through php script, well you can do it

you can do this:

<?php
echo substr(sprintf('%o', fileperms('/directory')), -4);
echo substr(sprintf('%o', fileperms('/directory/subdirectory')), -4);
?>


OUTPUT
1777
0644


with this, you can verify or show what are the permissions for a certain file in php in your directories from your website.
Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
hostman
#1749 1
you can also use is_writeable() function;

more at:

http://www.php.net/manual/en/function.fileperms.php
Mar 01, 2008 Reply Report abuse
©2011 Webune Forums - Mon Dec 19, 2011 6:23 pm
Powered by: Webune Forums V3