[Bug 723330] Re: rename() function didn't work with /tmp dir

Clint Byrum clint at fewbar.com
Fri Feb 25 01:13:43 UTC 2011


Hi Djalma! Thanks for taking the time to file this bug report and help
us make Ubuntu better.

Indeed, the error message is confusing, because while you called rename,
copy is complaining.

This happens because of this snippet of code:


    ret = VCWD_RENAME(url_from, url_to);

    if (ret == -1) {
#ifndef PHP_WIN32
# ifdef EXDEV
        if (errno == EXDEV) {
            struct stat sb;
            if (php_copy_file(url_from, url_to TSRMLS_CC) == SUCCESS) {
                if (VCWD_STAT(url_from, &sb) == 0) {

Basically since your /tmp is a different partition than your home dir,
php must emulate the low level unix rename by copying the file. The copy
is failing because the source is a dir, and copy doesn't accept
directories.

This is a bug, with an unclear resolution. Either rename should copy
recursively the whole directory to the new device, or it should describe
the problem with its own error message rather than relying on copy to do
it in a confusing way.

I've forwarded the issue upstream to PHP, so I'll mark the issue as
Triaged. There's nothing broken, its just not doing what we'd like it
to, so I'l set status to Wishlist.


** Changed in: php5 (Ubuntu)
       Status: New => Triaged

** Changed in: php5 (Ubuntu)
   Importance: Undecided => Wishlist

** Bug watch added: bugs.php.net/ #54097
   http://bugs.php.net/bug.php?id=54097

** Also affects: php via
   http://bugs.php.net/bug.php?id=54097
   Importance: Unknown
       Status: Unknown

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to php5 in ubuntu.
https://bugs.launchpad.net/bugs/723330

Title:
  rename() function didn't work with /tmp dir



More information about the Ubuntu-server-bugs mailing list