Bug #53601 [Opn->Csd]: function rename
Edit report at http://bugs.php.net/bug.php?id=53601&edit=1
ID: 53601
Updated by: iliaa@php.net
Reported by: tom_84 at hotmail dot it
Summary: function rename
-Status: Open
+Status: Closed
Type: Bug
Package: Filesystem function related
Operating System: debian lenny
PHP Version: 5.2.16
-Assigned To:
+Assigned To: iliaa
Block user comment: N
Private report: N
New Comment:
If version 5.2.16 works properly, why the bug? You are reporting an
issue on the
basis of a very old PHP, 5.2.6
Previous Comments:
------------------------------------------------------------------------
[2010-12-24 22:01:11] tom_84 at hotmail dot it
I'm not expecting this strange behavior, in fact I have experienced that
in my test case the function rename() it's not executed.
I think that this behavior is php version-related, because on newer php
version the job is done exactly as expected.
This is my phpinfo() http://torms.hellospace.net/zzz/php.php
Happy Christmas to all the php developer!
Regards, Tommaso
------------------------------------------------------------------------
[2010-12-24 05:42:25] aharvey@php.net
Why are you expecting rename() to fail in this case?
Even if $file was open when rename() was called (and it's not, in this
case), that doesn't prevent a file being renamed on most operating
systems, Linux included.
------------------------------------------------------------------------
[2010-12-24 00:32:36] tom_84 at hotmail dot it
Description:
------------
---
From manual page: http://www.php.net/function.rename
---
This function should return false on error during file renomination, but
in my test script inclusion is executed but renomination it's not
executed (no output, expected output:0).
Test script:
---------------
$file = getcwd()."/test.php";
$file2 = $file.".inc";
if (file_exists($file))
{ include $file;
echo rename($file,$file2);
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=53601&edit=1
Thread (4 messages)