note 40805 added to function.ftp-mkdir
| From: | vladimir at lukianov dot name | Date: | Mon, 15 Mar 2004 15:28:35 +0000 |
| Subject: | note 40805 added to function.ftp-mkdir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-66867@lists.php.net to get a copy of this message | ||
For recurrent following function work better.
Some ftp servers (like WarFTP) become demented if you'll
try mkdir not from root dir and if path will be relative.
The second if one of dir (like '/') already exist You'll get access denied.
function MkDir($path)
{
$dir=split("/", $path);
$path="";
$ret = true;
for ($i=1;$i<count($dir);$i++)
{
$path.="/".$dir[$i];
echo "$path\n";
if(!@ftp_chdir($this->conn_id,$path)){
@ftp_chdir($this->conn_id,"/");
if(!@ftp_mkdir($this->conn_id,$path)){
$ret=false;
break;
}
}
}
return $ret;
}
----
Manual Page -- http://www.php.net/manual/en/function.ftp-mkdir.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40805
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40805&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40805&report=yes
Search -- http://master.php.net/manage/user-notes.php