
January 21st, 2010, 01:19 PM
|
|
Registered User
|
|
Join Date: Jan 2010
Posts: 2
Time spent in forums: 3 h 39 m 48 sec
Reputation Power: 0
|
|
Cant set correct file permissions chmod()
Hi,
I have a script that reads through a dir and checks the file permissions but i cant seem to set them 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
|