PHP 4.0 Bug #5455 Updated: readdir() still doesn't work
| From: | Bug Database | Date: | Thu, 07 Sep 2000 18:21:47 +0000 |
| Subject: | PHP 4.0 Bug #5455 Updated: readdir() still doesn't work | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-32603@lists.php.net to get a copy of this message | ||
ID: 5455
User Update by: johan@ekenberg.se
Old-Status: Feedback
Status: Closed
Bug Type: Directory function related
Description: readdir() still doesn't work
Finally solved thanks to stas@zend.com
Should be in CVS soon.
Previous Comments:
[2000-09-07 03:50:40] johan@ekenberg.se
Added closedir() but it doesn't help.
I've also added a third example with your exact code request. Try it out here: http://www.ekenberg.se/readdir/index.php
Sorry to say it doesn't work either.
If you tell me there are really any changes to opendir() in the latest CVS that would motivate an
upgrade, I'm willing to try - but this is the third time I'm asked to upgrade to the
latest CVS or stable version with the same motivation: "It works for me". But it
hasn't still.
I'd be happy to provide a user account on the server if that would be of any help.
It seems this bugreport more or less duplicates bug no. 5540.
---------------------------------------------------------------------------
[2000-09-06 17:50:12] sniper@php.net
You don't use closedir() anywhere in your code.
Please try this example:
<?php
$dir = opendir(".");
while ($file = readdir($dir)) {
if ($file != "." && $file != "..") {
echo "$file<br>";
}
}
closedir($dir);
?>
If this doesn't help, upgrade to latest CVS.
This works just fine for me.
--Jani
---------------------------------------------------------------------------
[2000-09-06 05:08:18] johan@ekenberg.se
I've still got the problem after upgrade to 4.02.
System is libc5 (Slackware 4.0) running 2.2.16.
Example code and phpinfo() available here:
http://www.ekenberg.se/readdir/index.php
---------------------------------------------------------------------------
[2000-09-02 20:13:46] sniper@php.net
Please upgrade to php4.0.2. I just tried your example code and
it works just fine for me.
Reopen if problem still persists.
--Jani
---------------------------------------------------------------------------
[2000-07-15 09:53:01] johan@ekenberg.se
Stefan Kirch [s.kirch at bauer-kirch.de] mailed me:
-- start quote --
I have the same problem (#5535) and found a "work-around" like the following:
if (ereg("^foo$", $file)) {
RegEx works fine, so it seems to be a problom of string-comparison. Codes like
if ($x == "5") {
also breaks the loop, on the other hand, numerical comparisons like
if ($x == 5) {
works fine.
-- end quote --
I don't know if this might give any clues to the experts?
---------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view the rest of the comments,
please view the bug report online.
Full Bug description available at: http://bugs.php.net/?id=5455