php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5566 invalid Directory resource from opendir, but only sometimes?
Submitted: 2000-07-13 18:47 UTC Modified: 2000-07-13 18:49 UTC
From: johnf at aztech-cs dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0.1 OS: linux redhat 2.2.16
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: johnf at aztech-cs dot com
New email:
PHP Version: OS:

 

 [2000-07-13 18:47 UTC] johnf at aztech-cs dot com
DESCRIPTION
Roughly half the time while reading from the directory handle, an invalid Directory resource error occurs.  (When page is repeatedly reloaded)

SCRIPT
# Load Directory Into Array

$dir = "../images/";

$handle = opendir($dir);
while ($file = readdir($handle)) {

  if ($file != "." && $file != "..") {

    $images[count($images)] = $file;

}
# Clean up and sort
closedir($handle);

CONFIGURE COMMANDS
'./configure' '--with-apxs=/usr/local/apache/bin/apxs' '--prefix=/usr' '--with-config-file-path=/etc/httpd/conf' '--with-pgsql' '--enable-debugger' '--with-gdbm' '--with-ndbm'

ALL PHP.INI SETTINGS ARE DEFAULT

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-13 18:49 UTC] sterling at cvs dot php dot net
fixed in 4.0.1pl2.
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 23:00:01 2026 UTC