View Single Post
Old 12-02-2008, 03:58 AM   #5 (permalink)
liveordie
The Visitor
 
Join Date: Nov 2008
Posts: 3
Thanks: 0
liveordie is on a distinguished road
Default

Have you tried the php5 SPL library?

PHP Code:
<?php
$path 
realpath('C:/xampp/htdocs/');

$objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST);
foreach(
$objects as $object){
    echo 
$object->getFilename() . '<br />';
}
Something like that will recursively read through all of the directories and files. Its taken straight from the php manual for the most part. $object in the foreach loop is an instance of SplFileInfo

http://us3.php.net/manual/en/class.r...ryiterator.php

Just running some microtime tests on it, it will parse through 380 directories containing 3700 files in a little over 2 seconds.
liveordie is offline  
Reply With Quote