ID:               50676
 Updated by:       ahar...@php.net
 Reported By:      andreas at heigl dot org
 Status:           Bogus
 Bug Type:         Filesystem function related
 Operating System: Mac OS X 10.6
 PHP Version:      5.3.1
 New Comment:

The warnings may also be coming from the chown() and chmod() calls that
occur between the copy and unlink when the rename call has to be faked
across partitions -- there's no way of distinguishing them, since the
warnings in php_plain_files_rename() just wrap strerror().

I wonder if this might be worth morphing into a doc bug: the rename
manual page currently says that, as of 4.3.3, "rename() is now able to
rename files across partitions on *nix based systems", which does seem
to be overstating things a little. Something along the lines of
"rename() may be able to rename files across partitions on *nix based
systems, provided the appropriate permissions are held. Warnings may be
thrown if the destination filesystem doesn't permit chown() or chmod()
calls to be made on files." might be better.


Previous Comments:
------------------------------------------------------------------------

[2010-01-14 15:10:12] paj...@php.net

Volumes can be mounted everywhere on windows as well. That does not
change the fact that they are a different volume. Please read the
underlying documentations for rename and how it works, that may help to
understand the limitation.

------------------------------------------------------------------------

[2010-01-14 14:45:05] andreas at heigl dot org

I understand, that rename can only operate on the same volume (like the
move-command). But unlike in windows on a Mac (as on any other UNIX-like
environment) volumes can be mount anywhere in the folder-hirachy, so
that it is rather difficult to check whether source and target of the
rename are on the same volume or not.

And as I pointed out in the original bug-report, the source-file
actually is deleted, so there is no need for the error message.

------------------------------------------------------------------------

[2010-01-14 13:56:49] il...@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

rename() can only work "normally" when operating on the same volume. 

In your case it emulates rename via copy & delete. I would guess since

it cannot delete file from the original volume, it gives you an error 
message.

------------------------------------------------------------------------

[2010-01-11 12:59:23] p dot szalko at gmail dot com

The same bug is in PHP 5.2.11 and Mac OS X 10.5

------------------------------------------------------------------------

[2010-01-06 10:16:00] andreas at heigl dot org

Description:
------------
When renaming files acros Volumes a warning is triggered that the 
"Operation is not permitted. 
The operation is executed though.

Reproduce code:
---------------
- Create two images and mount them (Image1, Image2). 
- Disable the 'Ignore Owner'-Feature on both of them and set
permissions so the WebServer can access the files.
- Add a file to one of the mounted volumes (touch
/Volumes/Image1/testfile)

ini_set ( 'error_reporting', E_ALL );
ini_set ( 'display_errors', true );
rename ( '/Volumes/Image1/testfile', '/Volumes/Image2/testfile' );


Expected result:
----------------
The file /Volumes/Image1/testfile has been copied to 
/Volumes/Image2/testfile ad the original file has been removed.
No error should be triggered

Actual result:
--------------
The file /Volumes/Image1/testfile has been copied to 
/Volumes/Image2/testfile ad the original file has been removed.

Additionally the following error is triggered:
rename(/Volumes/Image1/testfile,/Volumes/Image2/testfile): Operation
not 
permitted in renametest.php on line n


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=50676&edit=1

Reply via email to