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 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: 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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 16:01:29 2024 UTC