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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
42 + 36 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2021 The PHP Group
All rights reserved.
Last updated: Fri Jul 23 16:01:23 2021 UTC