Bug->Doc #50676 [Tbd->Csd]: rename across Volumes throws warning "Operation not permitted"

From: Date: Mon, 06 Sep 2010 04:05:22 +0000
Subject: Bug->Doc #50676 [Tbd->Csd]: rename across Volumes throws warning "Operation not permitted"
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-4980@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=50676&edit=1 ID: 50676 Updated by: aharvey@php.net Reported by: andreas at heigl dot org Summary: rename across Volumes throws warning "Operation not permitted" -Status: To be documented +Status: Closed -Type: Bug +Type: Documentation Problem -Package: Filesystem function related +Package: Documentation problem Operating System: Mac OS X 10.6 PHP Version: 5.3.1 Assigned To: aharvey Block user comment: N New Comment: This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. Committed a slight variation on what I originally proposed, mostly to note that FAT filesystems are the most likely culprits here. Previous Comments: ------------------------------------------------------------------------ [2010-09-06 06:05:04] aharvey@php.net Automatic comment from SVN on behalf of aharvey Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=303064 Log: Fix doc bug #50676 (rename across Volumes throws warning &quot;Operation not permitted&quot;). ------------------------------------------------------------------------ [2010-09-03 20:51:51] pajoye@php.net See your own comment :-) ------------------------------------------------------------------------ [2010-09-03 09:19:20] sta at netimage dot dk I would like to second the suggestion of aharvey@php.net about making this a Documentation issue. I just spend 2 ours trying to figure out why rename() started spitting out warnings and still returned true. It could be something like <blockquote> <p> <b class="note">Note</b>: <span class="simpara"> If $oldname and $newname are on different partitions (on *nix based systems) the function might emit a warning "Warning: rename(oldfil,newfile): Operation not permitted" and still succeed. The reason is that internally the rename is done by copying the file, and attempting chown() and chmod() on the new file - and these operations can fail. </span> </p> </blockquote> FreeBSD, Apache 2.2, PHP 5.3.3. Thanks for all the good work. /Søren Thing ------------------------------------------------------------------------ [2010-01-14 15:21:34] aharvey@php.net 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. ------------------------------------------------------------------------ [2010-01-14 15:10:12] pajoye@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. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/bug.php?id=50676 -- Edit this bug report at http://bugs.php.net/bug.php?id=50676&edit=1

« previous php.doc.bugs (#4980) next »