Moving a file with 'rename'?
| From: | Tim Stoop | Date: | Thu, 04 Jul 2002 13:03:34 +0000 |
| Subject: | Moving a file with 'rename'? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-105432@lists.php.net to get a copy of this message | ||
Hi people,
I want to move a file from one location to another. I expect I can only do
this with 'rename', because there's no 'move'-command (at least nog in the
manual). Following situation:
original file: /var/www/html/webfotos/tmp/thumb_phpibmGBF.jpg
with /var/www/html/webfotos being a symlink to /home/cvd/sanbox/webfotos
new location: /var/www/html/foto/0/0/0/0/0000.thumb.jpg
syntax: rename($old_location, $new_location);
Error: Warning: Rename failed (Invalid cross-device link) in
/home/cvd/sandbox/webfotos/admin/save.php on line 95
When I 'su' to 'apache' (the user under which the httpd is running), I can
do the following without any error:
mv /var/www/html/webfotos/tmp/thumb_phpibmGBF.jpg
/var/www/html/foto/0/0/0/0/0000.thumb.jpg
Any ideas on why I get the error and how I can solve it? Tia!
--
Kind regards,
Tim