×

Pages

Labels

Search

×

Pages

×
×

Notice

The site is currently undergoing scheduled maintenance, and may not function correctly. Please come back later.

Advertisement

advertisement

is_file PHP Function Returning TRUE When File No Longer Exists

PHP's is_file function will return TRUE even if the file no longer exists, if the file was there recently, and is_file was recently used on it. This happens because the results of is_file are cached. You can get around this by clearing the cache before re-using is_file on this file. To clear the cache use the clearstatcache function.

For example:
[code]
is_file($file);
clearstatcache();
is_file($file);
[/code]

Notes:
-

License:Comprehensible Open License 3.0

Comprehensible Open License 3.0

Material provided under the terms of this license can be used in any manner, provided the following conditions are met: The authors of the material are not held responsible for any consequence of using the material. The material remains under the terms of this license. The terms of this license are upheld in accordance with the federal laws of Canada in place as of January 1, 2019.

Advertisment

advertisement
Copyright © James Daniel Marrs Ritchey.

Siteviews