Hi all. I'm attempting to use Pear's File_Find package, specifically the File_Find->maptree() method, and I'm running into a strange problem.
I'm trying to get a list of all .htm or .html files in a website, and for some reason it seems to be recognizing only the first 1650 files and when I count only html or htm files there are just 245. I know for certain there are MANY more than that in the entire site, the entire number being closer to 8000 for html files alone.
Here's the code:
Does anyone have any idea why it's only processing the first 1650 files it encounters?
It should read each directory under the directory I'm specifying, recursively down through the entire tree, but if you take a look here, you'll see that it stops after it hits 1650.
Does anyone have any ideas? I'm completely stuck on this one.
Thanks much in advance,
Pablo
I'm trying to get a list of all .htm or .html files in a website, and for some reason it seems to be recognizing only the first 1650 files and when I count only html or htm files there are just 245. I know for certain there are MANY more than that in the entire site, the entire number being closer to 8000 for html files alone.
Here's the code:
Code:
include('PEAR/File/Find.php');
$f = new File_Find();
$tmp_files = $f->maptree('/u1/vservers/pg-adm-[URL unfurl="true"]www-02.unbc.ca/html');[/URL]
$files = array();
while (list(,$val) = each($tmp_files[1])) {
if (substr($val,-4) == '.htm' || substr($val,-5) == '.html') {
array_push($files,$val);
echo $val.'<br>';
}
}
Does anyone have any idea why it's only processing the first 1650 files it encounters?
It should read each directory under the directory I'm specifying, recursively down through the entire tree, but if you take a look here, you'll see that it stops after it hits 1650.
Does anyone have any ideas? I'm completely stuck on this one.
Thanks much in advance,
Pablo