Is there a readdir() limit?
Posted: Thu Mar 10, 2005 3:20 pm
I have a function for counting files in a directory but it won't seem to count over 54 files, is there a limit to the number of files that you can count in a directory?
the function I use is:
feyd | Please use
the function I use is:
Code: Select all
function count_files_in_dir($theDirectory) {
if ($adir = @opendir($theDirectory)) {
$i=0;
while ($afile = readdir($adir)) {
if ($afile=="." || $afile=="..") {
// Don't count them
} else {
$i++;
}
}//end while
closedir($adir);
}
return $i;
}feyd | Please use
Code: Select all
andCode: Select all
tags where approriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]