[PHP]File Changer

개발관련/PHP 2012. 4. 20. 15:23 |
";

// if we have Posix installed
$owner_id = fileowner('file_permissions.php');
$owner_array = posix_getpwuid($owner_id);
echo $owner_array['name'];

echo "
"; chown('file_permissions.php', 'kevin'); // chown only works if PHP is superuser // making webserver/PHP a superuser is a big security issue // if we have Posix installed $owner_id = fileowner('file_permissions.php'); $owner_array = posix_getpwuid($owner_id); echo $owner_array['name']; echo "
"; echo substr(decoct(fileperms('file_permissions.php')), 2); chmod('file_permissions.php', 0444); echo substr(decoct(fileperms('file_permissions.php')), 2); echo "
"; echo is_readable('file_permissions.php') ? 'yes' : 'no'; echo "
"; echo is_writable('file_permissions.php') ? 'yes' : 'no'; echo "
"; ?>

'개발관련 > PHP' 카테고리의 다른 글

[PHP]File Details  (0) 2012.04.20
[PHP]File Delete  (0) 2012.04.20
[PHP]File Basics  (0) 2012.04.20
[PHP]File Access  (0) 2012.04.20
[PHP]Date Time Unix  (0) 2012.04.20
Posted by 파노카페
: