php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5808 the function opendir does not return the list, but a value like Resource id #1
Submitted: 2000-07-27 10:39 UTC Modified: 2000-07-27 11:24 UTC
From: maximus80 at hotmail dot com Assigned:
Status: Closed Package: Other
PHP Version: 4.0.1 OS: linux redhat 6.2
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: maximus80 at hotmail dot com
New email:
PHP Version: OS:

 

 [2000-07-27 10:39 UTC] maximus80 at hotmail dot com
----- PHP Source code -----
<?php
                     $handle=opendir('.');
                     echo "Directory handle: $handle\n";
                     echo "Files:\n";
                     while ($file = readdir($handle)) {
                         echo "$file\n";
                     }
                     closedir($handle); 
                     ?>

----- PHP configure command ------
'./configure' '--with-apache=/usr/local/src/apache_1.3.12/' '--with-ttf' '--with-gd=/usr/local/'
                                      '--with-pdflib=/usr/local' '--with-pgsql=/usr/local/pgsql/' '--with-zlib' '--with-jpeg-dir=/usr/'
                                      '--with-tiff-dir=/usr/' '--disable-debug'

Description:

the first time that I execute the code, all it's OK, but the second, the third etc... the function opendir doesn't return the list of the files of the directory.

I have checked the permission of the directories and the files, but the function doesn't return the expected value.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-27 11:24 UTC] stas@php.net
Yes, opendir returns handle. That's how it is meant to work.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon May 12 04:01:29 2025 UTC