Hi there,

just wrote a short php routine to go rekursiv trough the filesystem. So i now have the prob that it consums to much memory.. maybe someone can help me?

<?php
function searcht($dirname){
static $z, $now, $filesarr,$handle,$file,$total,$newsearch,$dirname;
$handle=opendir($dirname);
while ($file = readdir ($handle)) {
if ($file != "." && $file != "..") {
if(is_dir("$dirname/$file")){
// echo "$filen";
$filesarr[]="$dirname/$file";
$total++;
}
}
}
//Debug code
// for($z=0;$z<count($filesarr);$z++){
// echo "$filesarr[$z]n";
// }
closedir($handle);
$now=count($filesarr);
while($now !=0){
$newsearch=array_pop($filesarr);
echo "Dirs still to go: $nown";
searcht($newsearch);
}
}
$total=0;
$search="x:/compaq";
searcht($search);
echo $total;
?>