I want to Chmod a file so it is writeable, and then restore it's old permissions. Will fileperms return the original permissions, and then can I chmod the file with what it returns like so:
I was told I may need to convert $perms to octal, is that righ?PHP Code:<?php
$perms = fileperms('./FILENAME.php');
chmod('./FILENAME', 0777);
chmod('./FILENAME', $perms);
?>




Reply With Quote