broken stat cache?
| From: | Yasuo Ohgaki | Date: | Wed, 25 Sep 2002 00:22:08 +0000 |
| Subject: | broken stat cache? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-88579@lists.php.net to get a copy of this message | ||
It seems stat cache is broken.
I've tried 4.0.4pl1 and 4.3.0-dev, functions that
should use stat cache do no use cache, but it just
call stat or access as requested.
<?php
$filename = 'test_file';
// make sure file does not exist
unlink($filename);
var_dump(is_readable($filename));
// create file
touch($filename);
chmod($filename, 0);
var_dump(is_readable($filename));
// remove file
unlink($filename); // chmod does not make difference
var_dump(is_readable($filename)); // This should use stat cache return
TRUE, isn't?
// clear cache and test again
clearstatcache($filename);
var_dump(is_readable($filename));
?>
we have 2 choices.
1) Fix stat cache
2) Change documentation
http://jp.php.net/manual/en/function.clearstatcache.php
Fixing this will break many scripts, probably.
Just point it out the problem I noticed, since Wez is
going to rewrite stat related code soon(?) IIRC.
--
Yasuo Ohgaki