From: naumovic at beotel dot yu Operating system: Win 2000 PHP version: 4.3.2 PHP Bug Type: Filesystem function related Bug description: rename() function caches a source file info
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 bug report at http://bugs.php.net/?id=25094&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25094&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25094&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=25094&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=25094&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=25094&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=25094&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=25094&r=support Expected behavior: http://bugs.php.net/fix.php?id=25094&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=25094&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=25094&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=25094&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25094&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=25094&r=dst IIS Stability: http://bugs.php.net/fix.php?id=25094&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=25094&r=gnused