Comment 2 for bug 723330

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

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.