php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #6281 readdir returns valid filenames only if they are <= 13 characters in length.
Submitted: 2000-08-21 14:44 UTC Modified: 2000-09-21 10:45 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: stephen dot anthony at nrc dot ca Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.0.1pl2 OS: IRIX 6.5.8f
Private report: No CVE-ID: None
 [2000-08-21 14:44 UTC] stephen dot anthony at nrc dot ca
Greater than 13 character filenames tend to return as garbage after the first 13/14 characters.  Compiled PHP with gcc 2.8.1 (built under IRIX 6.5.3m (?)).

An example of a returned file name with readdir is:  general399f1d3^Z01c  
Where the filename is:   general399f1d36ea41c  

Example code:

 $handle = opendir($config["base"] ."/contrib");
 while ($file = readdir($handle)) { $f++; }
 closedir($handle);
 if ($f > 2) { // if there are files to be processed
     $handle=opendir($config["base"] ."/contrib");
     while (($file = readdir($handle))!==false)
        {
          if ($file != "." && $file != "..") {
          print $file;
        }

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-23 08:49 UTC] sniper@php.net
Does this problem exist with more recent versions of php4
(from CVS or http://snaps.php.net ) ??

--Jani
 [2000-09-21 10:45 UTC] sniper@php.net
No feedback.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 06:01:31 2024 UTC