RE: [PHP] mkdir with PHP 4.3.4 and IIS 5.0 on Windows 2000

From: Date: Tue, 18 Nov 2003 19:40:37 +0000
Subject: RE: [PHP] mkdir with PHP 4.3.4 and IIS 5.0 on Windows 2000
Groups: php.general 
Request: Send a blank email to php-general+get-170146@lists.php.net to get a copy of this message
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:jay.blanchard@niicommunications.com] Sent: Tuesday, November 18, 2003 11:38 AM To: Dang Nguyen; php-general@lists.php.net 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

« previous php.general (#170146) next »