PHP 4.0 Bug #5308: Directory read() problems (again)
| From: | fmal at fmal dot com | Date: | Sat, 01 Jul 2000 13:31:02 +0000 |
| Subject: | PHP 4.0 Bug #5308: Directory read() problems (again) | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-23032@lists.php.net to get a copy of this message | ||
From: fmal@fmal.com
Operating system: AIX 4.3.3
PHP version: 4.0.1
PHP Bug Type: Scripting Engine problem
Bug description: Directory read() problems (again)
This problem was already open before 4.0.0 and was resolved
in 4.0.0. , but with 4.0.1 I have it again :
Jun 30 10:47:50 lorien syslog: PHP Warning: 1 is not a
valid Directory resource in news_pgm.inc on line 23
Naturally it does not list any file.
The script is :
00018 function buildNewsfile ()
00019 {
00020 global $newsdir, $newssuffix, $newsfile;
00021 $newsfile = array();
00022 $td = dir($newsdir);
00023 while ($filename = $td->read())
00024 {
00025 $s = strtolower($filename);
00026 if (strstr ($s, $newssuffix))
00027 {
00028 $lastchanged = filemtime($newsdir.$filename);
00029 $newsfile[$filename] = $lastchanged;
00030 }
00031 arsort($newsfile);
00032 }
00033 }
It is working OK under 4.0.0 and 3.0.16.
Thanks