PHP 4.0 Bug #9518 Updated: dir() only returns first 6 chars correctly
| From: | sniper@php.net | Date: | Fri, 02 Mar 2001 14:26:43 +0000 |
| Subject: | PHP 4.0 Bug #9518 Updated: dir() only returns first 6 chars correctly | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-47790@lists.php.net to get a copy of this message | ||
ID: 9518
Updated by: sniper
Reported By: waldowda@plu.edu
Old-Status: Open
Status: Feedback
Bug Type: Directory function related
Assigned To:
Comments:
Does this happen with PHP 4.0.4.pl1?
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2001-03-02 02:41:52] waldowda@plu.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:
CH104/
CH105/
CH120/
ABCDEFGHIJKL/
abcdefghijkl/
When I execute the following code:
chdir("$dir_path");
echo ("Dir Path = $dir_path<br>");
$dir = dir(".");
$dir -> rewind();
$file=$dir->read();
echo ("file is $file<br>n");
$file=$dir->read();
echo ("file is $file<br>n");
$file=$dir->read();
echo ("file is $file<br>n");
$file=$dir->read();
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
garbled.
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 bugs.php.net and email lists without finding information
related to this problem. Hope I have not missed it some where...
Dean
--
-----------------------------------------------------------------------------
Dean Waldow, Associate Professor (253) 535-7533
Department of Chemistry (253) 536-5055 (FAX)
Pacific Lutheran University waldowda@plu.edu
Tacoma, WA 98447 USA http://www.chem.plu.edu/waldow/
-----------------------------------------------------------------------------
---> CIRRUS, the UG research resource: http://cirrus.chem.plu.edu/ <---
-----------------------------------------------------------------------------
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=9518&edit=2