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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2023 The PHP Group
All rights reserved.
Last updated: Wed Feb 08 11:03:42 2023 UTC