Doc #50676 [Com]: rename across Volumes throws warning "Operation not permitted"
| From: | jorgex0 dot o at gmail dot com | Date: | Wed, 30 Oct 2013 13:59:46 +0000 |
| Subject: | Doc #50676 [Com]: rename across Volumes throws warning "Operation not permitted" | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-10566@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=50676&edit=1
ID: 50676
Comment by: jorgex0 dot o at gmail dot com
Reported by: andreas at heigl dot org
Summary: rename across Volumes throws warning "Operation not
permitted"
Status: Closed
Type: Documentation Problem
Package: Documentation problem
Operating System: Mac OS X 10.6
PHP Version: 5.3.1
Assigned To: aharvey
Block user comment: N
Private report: N
New Comment:
This isn't documented, for what I see. Am I right?
Previous Comments:
------------------------------------------------------------------------
[2010-09-06 06:05:22] aharvey@php.net
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.
------------------------------------------------------------------------
[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&revision=303064
Log: Fix doc bug #50676 (rename across Volumes throws warning "Operation not
permitted").
------------------------------------------------------------------------
[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.
------------------------------------------------------------------------
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
https://bugs.php.net/bug.php?id=50676
--
Edit this bug report at https://bugs.php.net/bug.php?id=50676&edit=1