PHP 4.0 Bug #6281: readdir returns valid filenames only if they are <= 13 characters in length.

From: Date: Mon, 21 Aug 2000 18:44:57 +0000
Subject: PHP 4.0 Bug #6281: readdir returns valid filenames only if they are <= 13 characters in length.
Groups: php.dev 
Request: Send a blank email to php-dev+get-30104@lists.php.net to get a copy of this message
From: stephen.anthony@nrc.ca Operating system: IRIX 6.5.8f PHP version: 4.0.1pl2 PHP Bug Type: Misbehaving function Bug description: readdir returns valid filenames only if they are &lt;= 13 characters in length. 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; }

« previous php.dev (#30104) next »