Bug #3699: function readdir() error
| From: | xutian at mail dot transfar dot com | Date: | Thu, 02 Mar 2000 08:15:12 +0000 |
| Subject: | Bug #3699: function readdir() error | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-16259@lists.php.net to get a copy of this message | ||
From: xutian@mail.transfar.com
Operating system: RedHat Linux 6.0
PHP version: 3.0.14
PHP Bug Type: Parser error
Bug description: function readdir() error
look at the below code:
<?
$handle=opendir('/home/txt/');
$i=0;
while ($file = readdir($handle)) {
if ($file != "." && $file != ".." && $file !="0")
{
echo $file."<br>";
$i++;
}
}
closedir($handle);
?>
if we have a file named 0 in dir "/home/txt/" and then we creat some other files, the
files' list in html will not include files last created.
i think maybe readdir return 0 when it get file who's name equal 0.