Re: mkdir()

From: Date: Wed, 28 Nov 2001 10:50:57 +0000
Subject: Re: mkdir()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-75875@lists.php.net to get a copy of this message
May be your httpd is running under nobody.nobody but the owner of the htdocs dir, or wherever are running your php scripts is owned by someone else. Regards, Andrey Hristov ----- Original Message ----- From: "Christoph Starkmann" <kiko@nfq.de> To: <php-general@lists.php.net> Sent: Wednesday, November 28, 2001 12:32 PM Subject: [PHP] mkdir() > Hi there! > > I got the following problem: > > I want to "mirror" a complete directory tree. Now I traverse > the original tree, do changes to some of the files and want to > write the resulting files to a parallel directory. > > Lets say $INPUT_PATH is the source path and $OUTPUT_PATH is > where I want to put the copies. > $file is the path o the current file. > > Now I tried to do the following: > > file://...snip... > > $outfileName = ereg_replace($INPUT_PATH, $OUTPUT_PATH, $file); > $OUTFILE = fopen($outfileName, "w") || die ("Oooops, couldn't open $file); > > // ... more blahblah... > > fclose($OUTFILE); > > But now I got an error: > > Warning: fopen("path/directory/template.html","w") - No such file or > directory in filename.php on line 231 > > Okay, I hoped PHP would create the directory, too, along with creating > the file Iwant to write to when it doesn't exist. > > When I try to create the directory "manually" using > > mkdir("path/directory", 0777) || die ("Yet another ugly death..."); > > I get yet another ugly error: > > Warning: MkDir failed (No such file or directory) in filename.php on line 29 > > Why is this? Of course there is no such file or directory... If there was, I > wouldn't have to create one ;) > > Any ideas? Hints? > > Every tidy bit of wisom is appreciated... > > Cheers, > > Kiko > > ----- > It's not a bug, it's a feature. > christoph starkmann > mailto:kiko@nfq.de > http://www.fh-augsburg.de/~kiko > ICQ: 100601600 > ----- > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#75875) next »