note 16412 added to function.mkdir
| From: | vincent at e-line dot be | Date: | Mon, 29 Oct 2001 09:41:15 +0000 |
| Subject: | note 16412 added to function.mkdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-19563@lists.php.net to get a copy of this message | ||
Hi,
I saw that moast people are talking about permissions like: 0777. But i'm wondering...
doesn't the logics of binary calculatings says that 0 decimal is equal to 0 binary? So you
might as well leave it away?
Here's my contribution:
function create_folder($path){
switch(PHP_OS){
case("WIN32"):
$rights = 764 ;
break;
case("Linux"):
$rights = 777 ;
break;
}
if(!@is_dir($path)){
$create_folder = mkdir($path, @$rights);
if(!$create_folder) die("Failed Creating folder '$path'");
}
Greetings,
Vincent
PHP is my guiding light, php.net the bible...
--
http://www.php.net/manual/en/function.mkdir.php
http://master.php.net/manage/user-notes.php?action=edit+16412
http://master.php.net/manage/user-notes.php?action=delete+16412
http://master.php.net/manage/user-notes.php?action=reject+16412