Archive for May, 2011
PHP check folder permissions for owner/group/world
where $folder is your folder path,
echo substr(sprintf('%o', fileperms($folder)), -4);
For example to check if your folder has read-write-execute permission for owner and group, and read only for world, you could do:
if (substr(sprintf('%o', fileperms($folder)), -4) == "0774") { $dir_writable = true; } else { $dir_writable = false; }
Of course, you can change the octal value to 0664 or whatever suites your need or permission need to be given for owner/group/world.
Categories: PHP
Tags: folder permission, PHP
Calendar
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
.Net
ahah
apache2
debian
folder permission
javascript
jcx software
microsoft httpapi
mssql
mssql_query
obama dreamhost web hosting
openssl
phalanger
PHP
php.net
php ide
SQL Server
ssl passphrase
SSLPassPhraseDialog
stored procedure
VMware
VMware server
vmwaretools
Windows Server
xmlhttprequest
zend