Re: cvs: phpdoc /en/reference/filesystem/functions clearstatcache.xml
| From: | Nuno Lopes | Date: | Fri, 06 Feb 2004 14:43:44 +0000 |
| Subject: | Re: cvs: phpdoc /en/reference/filesystem/functions clearstatcache.xml | ||
| References: | 1 2 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969358769@lists.php.net to get a copy of this message | ||
> "If you create the file, it will return &true; even if you then delete
> the file". Are you sure?
Oh yeah! read the Wez comment at http://bugs.php.net/27134
> <?php
> var_dump(file_exists('temp.txt'));
> touch('temp.txt');
> var_dump(file_exists('temp.txt'));
> unlink('temp.txt');
> var_dump(file_exists('temp.txt'));
> ?>
>
> Outputs:
>
> bool(false)
> bool(true)
> bool(false)
this is because PHP updates the info, but run this script:
<?
while(true) {
var_dump(file_exists('/tmp/foo'));
sleep(1);
}
where /tmp/foo is a file that doesn't exist. Then create the file. and then
delete again. Results?
false
true - when you create the file
true - even if you delete the file
Nuno