gileze Posted March 30, 2006 Share Posted March 30, 2006 Hi There.I am creating a script for automatic folder creation with full access priveliges.I know the decimal value for CHMOD is 777 but that doesnt work in PHP.Does anyone know the Octal value for 777?Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/6170-chmod-in-php/ Share on other sites More sharing options...
trq Posted March 30, 2006 Share Posted March 30, 2006 0777 Quote Link to comment https://forums.phpfreaks.com/topic/6170-chmod-in-php/#findComment-22267 Share on other sites More sharing options...
redbullmarky Posted March 30, 2006 Share Posted March 30, 2006 this might help too:[a href=\"http://uk2.php.net/chmod\" target=\"_blank\"]http://uk2.php.net/chmod[/a] Quote Link to comment https://forums.phpfreaks.com/topic/6170-chmod-in-php/#findComment-22279 Share on other sites More sharing options...
craygo Posted March 30, 2006 Share Posted March 30, 2006 Here is a breakdown of chmod. Even though php usesthe 4 digit code, ie 0755 only the last tree really mean anything.I will use and example of 0764 as a chmod0 = Sort of a buffer for php leave it at 07 = Owners Rights //Owners position6 = Group Rights //Group position4 = Everyone elses writes //Everyone positionThe digit can be any of the defined value (explained in a second) the position is important. Now the numbers are derived like so1 = Execute2 = Write4 = ReadSo what you do is add up the permissions you want to give and use that number in the position you want.Example above 764 meanOwner has full access Read, Write, Execute 4+2+1=7Group has Read, Write 4+2=6Everyone has Read 4Hope that helpsRay Quote Link to comment https://forums.phpfreaks.com/topic/6170-chmod-in-php/#findComment-22288 Share on other sites More sharing options...
gileze Posted March 30, 2006 Author Share Posted March 30, 2006 Ok thanks, all works now. Quote Link to comment https://forums.phpfreaks.com/topic/6170-chmod-in-php/#findComment-22293 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.