|  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
 [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>"; 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-06 04:21 UTC]
You should use while(($iden_dir = @readdir($directory_src))!==false)
Read the docs.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Oct 17 11:03:35 2021 UTC