Doc #73997 [Opn->Csd]: rename() won't overwrite existing directory
Edit report at https://bugs.php.net/bug.php?id=73997&edit=1
ID: 73997
Updated by: peehaa@php.net
Reported by: tim dot aagaard at gmail dot com
Summary: rename() won't overwrite existing directory
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: Filesystem function related
Operating System: NA
PHP Version: Irrelevant
-Assigned To:
+Assigned To: peehaa
Block user comment: N
Private report: 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.
Previous Comments:
------------------------------------------------------------------------
[2017-01-25 16:57:08] tim dot aagaard at gmail dot com
This behavior should be noted somewhere in the documentation
------------------------------------------------------------------------
[2017-01-25 16:55:49] tim dot aagaard at gmail dot com
Description:
------------
"rename â Renames a file or directory"
"Attempts to rename oldname to newname, moving it between directories if necessary. If newname
exists, it will be overwritten."
Rename will not overwrite a directory that already exists.
Test script:
---------------
mkdir('a/', 0777);
mkdir('b/', 0777);
rename('a/', 'b/');
Actual result:
--------------
Warning: rename(a/,b/): File exists
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=73997&edit=1
Thread (3 messages)