robembra Posted January 21, 2010 Share Posted January 21, 2010 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's but I dont understand them Thanks in advance Link to comment https://forums.phpfreaks.com/topic/189345-chmodmkdir-setting-wrong-file-permissions/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.