Ninjakreborn Posted May 4, 2007 Share Posted May 4, 2007 if (!mkdir($docroot . "/geosystems/projectfiles/" . $name, 0777)) { echo "Not-Created"; }else{ echo "created"; } quick example of the type of thing I am trying to use. The directory it's creating is 4 (roughly) levels doop. root/dev/g/projectfiles/created directory here I am trying to set the permissions to 777. But it's refusing to, it's setting them to 0555 755 I looked up and located a bug on php.net There was a fix looking like if (!mkdir($docroot . "/geosystems/projectfiles/" . $name, 01777)) { echo "Not-Created"; }else{ echo "created"; } I tried that fix and it still did not work. I needed to create the directory and give it 777 permissions because the files needed to be uploaded via ftp by the client, then I have other scripts automatically getting the file's "from" that directory. Any advice? Link to comment https://forums.phpfreaks.com/topic/50005-solved-mkdir-not-changing-permissions/ Share on other sites More sharing options...
Ninjakreborn Posted May 4, 2007 Author Share Posted May 4, 2007 Screw it, I chmodded it and it worked fine. However for future knowledge it might be cool to find out why mkdir didn't work as expected. Link to comment https://forums.phpfreaks.com/topic/50005-solved-mkdir-not-changing-permissions/#findComment-245453 Share on other sites More sharing options...
rameshfaj Posted May 4, 2007 Share Posted May 4, 2007 use mkdir("filepath/filename") after using the chmod() command and it should work. Link to comment https://forums.phpfreaks.com/topic/50005-solved-mkdir-not-changing-permissions/#findComment-245459 Share on other sites More sharing options...
Ninjakreborn Posted May 4, 2007 Author Share Posted May 4, 2007 Ok, thanks I appreciate it. Link to comment https://forums.phpfreaks.com/topic/50005-solved-mkdir-not-changing-permissions/#findComment-245565 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.