[PHP] Moving a file with 'rename'?
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/.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/.thumb.jpg Any ideas on why I get the error and how I can solve it? Tia! -- Kind regards, Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Moving a file with 'rename'?
Hello Tim, Tim why don't you try shell_exec ? Thursday, July 4, 2002, 5:03:34 PM, you wrote: TS Hi people, TS I want to move a file from one location to another. I expect I can only do TS this with 'rename', because there's no 'move'-command (at least nog in the TS manual). Following situation: TS original file: /var/www/html/webfotos/tmp/thumb_phpibmGBF.jpg TS with /var/www/html/webfotos being a symlink to /home/cvd/sanbox/webfotos TS new location: /var/www/html/foto/0/0/0/0/.thumb.jpg TS syntax: rename($old_location, $new_location); TS Error: Warning: Rename failed (Invalid cross-device link) in TS /home/cvd/sandbox/webfotos/admin/save.php on line 95 TS When I 'su' to 'apache' (the user under which the httpd is running), I can TS do the following without any error: TS mv /var/www/html/webfotos/tmp/thumb_phpibmGBF.jpg TS /var/www/html/foto/0/0/0/0/.thumb.jpg TS Any ideas on why I get the error and how I can solve it? Tia! TS -- TS Kind regards, TS Tim -- Best regards, Latexmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Moving a file with 'rename'?
rename can move the file only on the same partition, it is realy just _rename_, not full _move_ Marek Tim Stoop wrote: 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/.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/.thumb.jpg Any ideas on why I get the error and how I can solve it? Tia! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Moving a file with 'rename'?
Marek Kilimajer wrote: rename can move the file only on the same partition, it is realy just _rename_, not full _move_ So there is no full-features move in PHP? -- Kind regards, Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Moving a file with 'rename'?
Latex Master wrote: Hello Tim, Tim why don't you try shell_exec ? As a last resort, I might, but I'd rather do it in PHP... Code-portability, y'know :) -- Kind regards, Tim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Moving a file with 'rename'?
None that I know of. You need to use copy unlink Tim Stoop wrote: Marek Kilimajer wrote: rename can move the file only on the same partition, it is realy just _rename_, not full _move_ So there is no full-features move in PHP? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php