note 105888 modified in function.clearstatcache by danbrown
| From: | danbrown@php.net | Date: | Fri, 23 Sep 2011 15:59:23 +0000 |
| Subject: | note 105888 modified in function.clearstatcache by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-183371@lists.php.net to get a copy of this message | ||
unlink() does not clear the cache if you are performing file_exists() on a remote file like:
<?php
if (file_exists("ftp://ftp.example.com/somefile"))
?>
In this case, even after you unlink() successfully, you must call clearstatcache().
<?php
unlink("ftp://ftp.example.com/somefile");
clearstatcache();
?>
file_exists() then properly returns false.
--was--
unlink() does not clear the cache if you are performing file_exists() on a remote file like:
<?php
if (file_exists("ftp://someftpserver.com/somefile"))
?>
In this case, even after you unlink() successfully, you must call clearstatcache().
<?php
unlink("ftp://someftpserver.com/somefile");
clearstatcache();
?>
file_exists() then properly returns false.
http://php.net/manual/en/function.clearstatcache.php