|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-08-15 07:08 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 16 12:00:01 2025 UTC |
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