Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Pear File_Find package

Status
Not open for further replies.

pgosse

Programmer
Sep 26, 2001
42
CA
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:

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top