Can't Make Directories Now
| From: | Seth Willits | Date: | Mon, 01 Sep 2003 22:02:06 +0000 |
| Subject: | Can't Make Directories Now | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-161390@lists.php.net to get a copy of this message | ||
I figured out the permissions issue to allow gd to create image files, but I also need to create folders for those images. I've come up with a routine (below) but it fails to create the directories. I've made sure that the directory that the first directory is created in has the appropriate permissions, but it doesn't work.
<?php
$path = "path/path2/path3/path4/path5";
$buildingPath = "existingFolder";
$pathComponents = split("/", $path);
foreach ($pathComponents as $value) {
$buildingPath = $buildingPath . "/" . $value;
print $buildingPath . '<br>';
if (opendir($buildingPath) == false)
if (!mkdir($buildingPath))
print 'false <br>';
else
closedir($buildingPath);
}
?>
The paths to the folders its supposed to create are correct ($buildingPath), but it always prints false signaling that mkdir has failed.
This is the last remaining issue on getting my site finished. Well except for uploading, but I don't need that just yet.
Seth Willits
---------------------------------------------------------------------------
President and Head Developer of Freak Software - http://www.freaksw.com
Q&A Columnist for REALbasic Developer Magazine - http://www.rbdeveloper.com
Webmaster for REALbasic Game Central - http://www.freaksw.com/rbgames
"It's all about the belly fire."
-- David Sepe ---------------------------------------------------------------------------