|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9518 dir() only returns first 6 chars correctly
Submitted: 2001-03-02 02:41 UTC Modified: 2001-06-23 20:57 UTC
From: waldowda at plu dot edu Assigned:
Status: Closed Package: Directory function related
PHP Version: 4.0.2 OS: IRIX 6.5.7
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.
Block user comment
Status: Assign to:
Bug Type:
From: waldowda at plu dot edu
New email:
PHP Version: OS:


 [2001-03-02 02:41 UTC] waldowda at plu dot edu
Hi Folks,

I have run into a problem using the dir() function.

The following code behaves properly on linux and does not using irix:

Contents of the dir (only folders) are:


When I execute the following code:

echo ("Dir Path = $dir_path<br>");
$dir = dir(".");
$dir -> rewind();
echo ("file is $file<br>\n");
echo ("file is $file<br>\n");
echo ("file is $file<br>\n");
echo ("file is $file<br>\n");

I get the following incorrect results (php 4.0.2, irix 6.5.7)

Dir Path = /Public/Web/db/msds
file is .
file is ..
file is CH104
file is CH105
file is CH120
file is ABCDEF??~KL
file is abcdef??~kl

So, it appears that if the dir (or file) is less than or equal to 6 char the
dir() function work correctly.  However, if it is longer, the name get

On a redhat linux box (php 4.0.2), it works fine and I get proper dir names. 
This behavior is the same for filenames not just dir names.

I have checked the and email lists without finding information
related to this problem.  Hope I have not missed it some where...

Dean Waldow, Associate Professor             (253) 535-7533
Department of Chemistry                      (253) 536-5055 (FAX)
Pacific Lutheran University         
Tacoma, WA  98447   USA             
--->    CIRRUS, the UG research resource:    <---


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-02 09:26 UTC]
Does this happen with PHP 4.0.4.pl1? 


 [2001-03-02 10:31 UTC] waldowda at plu dot edu
Hi Jani,

Thanks for the message.  I have not tried that distribution.  It took me many months to get a successful install on my irix box and I am a bit reluctant right now to take a chance and maybe 'break it'.  8-) The php/mysql system is current running an abstract service for a regional chemical conference and I don't want to take a chance at making that go down.  8-)  The abstract deadline is the 16th of march and after that I feel comfortable enough trying to building a new version on the irix box.  BTW, php/mysql has been a great addition to the my uses for chemistry web servers. 

Sorry for asking for help and not being able to try your suggestion until a couple of weeks.

I will try the lasted non-snapshot release as soon as the server is not so critical.  I am guessing that I could maybe try to build it so that is doesn't write over the current working version.  If I can figure that out, I will try to get to that sooner.

Thanks again for the quick resonse!
 [2001-06-23 20:57 UTC]
Reopen if this happens with PHP 4.0.6.

PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Jul 24 08:01:23 2021 UTC