In my case, I've created a function called mkdirs that recursively checks
and does a mkdir on a given path.  So, if any of the folders in a given path
don't exist, then they will get created.  I include this at the top via
"include('func/mkdirs.php');".  I've used this mkdirs function in other
scripts, and I know it's working fine.

mkdirs.php contains:
<?
// This function will recursively execute the mkdir function to create an
entire directory path
// rewritten to accommodate UNC paths

function mkdirs($strPath, $mode=0755)
{

  if (is_dir($strPath)) return true;

  if(strrpos($strPath,'\\') > 1) {
      $pStrPath = dirname($strPath);
      if (!mkdirs($pStrPath, $mode)) return false;
  }

  return mkdir($strPath,$mode);
}
?>

-----Original Message-----
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 18, 2003 11:38 AM
To: Dang Nguyen; [EMAIL PROTECTED]
Subject: RE: [PHP] mkdir with PHP 4.3.4 and IIS 5.0 on Windows 2000


[snip]
mkdirs($directory,0755);
[/snip]

should be 
mkdir($directory,0755);

make sure the script has permission to make a directory, most scripts
run as 'nobody' and 'nobody' does not have permission to create a
directory

http://us3.php.net/mkdir

Reply via email to