#36365 [Com]: scandir duplicates file name at every 65535th file
| From: | enzo at smshome dot net | Date: | Thu, 07 Jan 2010 18:02:52 +0000 |
| Subject: | #36365 [Com]: scandir duplicates file name at every 65535th file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-146416@lists.php.net to get a copy of this message | ||
ID: 36365
Comment by: enzo at smshome dot net
Reported By: pilhoon at gmail dot com
Status: No Feedback
Bug Type: Directory function related
Operating System: windows
PHP Version: 5.1.2
New Comment:
Same problem here using PHP Version 5.2.5 (x64) with Windows XP 64bit
Professional Edition.
Duplicated files every 65535 files read using scandir(). I think you
should put an alert on manual page:
http://php.net/manual/en/function.scandir.php
Previous Comments:
------------------------------------------------------------------------
[2006-02-19 01:00:04] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2006-02-11 13:21:34] sniper@php.net
Please try using this CVS snapshot:
http://snaps.php.net/php5.1-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.1-win32-latest.zip
------------------------------------------------------------------------
[2006-02-11 03:17:52] pilhoon at gmail dot com
Description:
------------
scandir duplicates file name at every 65535th file
Reproduce code:
---------------
I made over 260000 files in a folder.
Their names are 'f100001' ... 'f264001'.
$file_names = scandir('files/');
$base_names= array();
for($i=100001; $i<=263064; $i++)
{
$base_names["f".$i] = 0;
}
foreach($file_names as $a_name)
{
if(1 == $base_names[$a_name])
echo $a_name."\n";
else
$base_names[$a_name] = 1;
}
Expected result:
----------------
They must be showed only once.
Actual result:
--------------
scandir(THAT_FOLDER) returns large array but
f165534 and f231069 are duplicated.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=36365&edit=1