Hi,
I have a script that reads through a dir and checks the file permissions agaist a list, but i cant seem to set the permissions correctly. I am using the code below:
$perms = substr(sprintf('%o', fileperms($file)), -4);chmod($new_folder_path, $perms);
Say a file is 0755 it will make it 431 or something and then I cant read the dir at all. I have tried all sorts playing with the format of the variable but im just going backwards.
$perms = 0755 and is numeric
I thinks its something to do with octdel but I dont understand them .
Thanks