php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17610 listing file with readdir
Submitted: 2002-06-05 08:28 UTC Modified: 2002-06-06 04:21 UTC
From: sfarran at centrimage dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.1.2 OS: linux mandrake 8.1
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: sfarran at centrimage dot com
New email:
PHP Version: OS:

 

 [2002-06-05 08:28 UTC] sfarran at centrimage dot com
When I do a readdir in a directory, Php forget some files

My directory have about 3000 files
size of files: 1.4Mo
type: sgi (pictures)
name of files: quad.xxxx.sgi (xxxx is a number, ie 0001) 

I've done tests on this directory, and listed files are never the same. Sometimes, Php forget files, but forgotten files are not the same one time to another.

Is there limits on the use if readir function?

my code for listing files is:

$directory_src = @opendir("/tmp"); 
while($iden_dir = @readdir($directory_src)) 
{ 
    echo "$iden_dir<BR>"; 
} 
@closedir($directory_src); 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-06 04:21 UTC] sander@php.net
You should use while(($iden_dir = @readdir($directory_src))!==false)
Read the docs.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 07 01:01:34 2025 UTC