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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 21:01:27 2024 UTC