ID: 25094 Updated by: [EMAIL PROTECTED] Reported By: naumovic at beotel dot yu -Status: Open +Status: Bogus Bug Type: Filesystem function related Operating System: Win 2000 PHP Version: 4.3.2 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php The code works properly, after you've renamed the file 'oldFile.txt' no longer exists, which is why file_exists() returns 0/FALSE. Previous Comments: ------------------------------------------------------------------------ [2003-08-14 06:53:34] naumovic at beotel dot yu Description: ------------ When i try to rename a file, then to check if the source file exists, file_exists() returns me true. A conclusion is that a source file info is cached when using rename() function. My solution was to call clearcache() between rename() and file_exists(). I'm not sure if anyone else will consider it as a bug, but i suppose it's not a desired behavior. In the Reproduce code i put casting into integer just for the sake of displaying 0 if the file doesn't exist instead of an empty string. Reproduce code: --------------- rename('oldFile.txt', 'newFile.txt'); echo((int) file_exists('oldFile.txt'); Expected result: ---------------- 1 Actual result: -------------- 0 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=25094&edit=1