Edit report at http://bugs.php.net/bug.php?id=53601&edit=1
ID: 53601 User updated by: tom_84 at hotmail dot it Reported by: tom_84 at hotmail dot it Summary: function rename -Status: Feedback +Status: Open Type: Bug Package: Filesystem function related Operating System: debian lenny PHP Version: 5.2.16 Block user comment: N Private report: N New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [2010-12-24 05:42:25] ahar...@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