php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #3326 readdir doesn't give ALL names of a directory (some names are missing!!)
Submitted: 2000-01-26 23:18 UTC Modified: 2000-03-18 09:10 UTC
From: php3_bug_report at pepsi dot itgo dot com Assigned:
Status: Closed Package: Other
PHP Version: 3.0.12 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php3_bug_report at pepsi dot itgo dot com
New email:
PHP Version: OS:

 

 [2000-01-26 23:18 UTC] php3_bug_report at pepsi dot itgo dot com
your example script:

<?php
                        $handle=opendir('.');
                        echo "Directory handle: $handle\n";
                        echo "Files:\n";
                        while ($file = readdir($handle)) {
                            echo "$file\n";
                        }
                        closedir($handle); 
?>

the directory listing:
drwxr-xr-x   4 userr  users        1024 Jan 27 04:57 ./
drwxr-xr-x   3 userr  users        1024 Jan 17 12:04 ../
drwxr-xr-x   2 userr  users        1024 Jan 27 04:55 Bilder/
-rw-r--r--   1 userr  users       29184 Jun 24  1999 call-by-call.xls
-rw-r--r--   1 userr  users         185 Dec 15 20:29 index.alt
drwxrwxrwx   2 userr  users        1024 Jan 27 04:55 uploads/

what I get:
.
..
uploads
call-by-call.xls


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-02-06 06:28 UTC] sas at cvs dot php dot net
Change

while ($file = readdir($handle)) {

to

while (($file = readdir($handle)) != "") {
 [2000-02-06 13:51 UTC] php3_bug_report at pepsi dot itgo dot com
I have already tried this version 
I tried '!=false' and '!=""' - same result - 
the only difference is the problem with the file "0" 
mentioned in some other bug-reports (for example id=1236)
 [2000-03-18 09:10 UTC] php3_bug_report at pepsi dot itgo dot com
I found the error in MY source - sorry
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 19 20:01:30 2024 UTC