http://www.php.net/manual/en/function.copy.php
Thanks all! I needed to check if pathname exists:
if (!is_dir($to_path))
{
echo "Creating destination path";
create_path($to_path);
}
John Steele helped out with a few lines of code. I added a comment to
http://www.php.net/manual/en/function.cop
So I just declare at the beginning:
if(!is_dir($to_path))
mkdir($to_path, 0777);
The code works. But how can I make sure $from_path exists first and fails if
not?
Same thing?
if(!is_dir($from_path))
{
echo "failed";
exit;
}
The first time I ran it, I ran it with a non-existing $from_path direc
On Thursday 14 March 2002 11:37, jtjohnston wrote:
> You might have seen a version of this function:
>
> http://www.php.net/manual/en/function.copy.php
>
> I would like to rework this line:
>
> mkdir($to_path, 0777);
>
> where mkdir will ignore $to_path if
> the directory already exists.
You might have seen a version of this function:
http://www.php.net/manual/en/function.copy.php
I would like to rework this line:
mkdir($to_path, 0777);
where mkdir will ignore $to_path if
the directory already exists. I have already tried this:
#if(!mkdir($to_path, 0777))
# {mkdir($
4 matches
Mail list logo