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:

//...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:[EMAIL PROTECTED]
http://www.fh-augsburg.de/~kiko
ICQ: 100601600
-----

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to