Next Program Repair Shop 209

The Condition that Ate Michigan (Digression)

     Subject: Quicker way to loop through directories?
     Message-ID: <9q1f65$ht6@newton.cc.rl.ac.uk>
     if(opendir(DIR, "f:/list-logs"))
     {
       while($dir = readdir(DIR))
       {
         if(-d "f:/list-logs/$dir" and $dir ne "." and $dir ne "..")
         {
           if(opendir(SUB, "$listlogs/$dir"))
           {
             while($file = readdir(SUB))
             {
               if($file =~ /\.log.+/i)
               {
                 $total += -s "$listlogs/$dir/$file";
               }
             }
             closedir(SUB);
           }
         }
       }
       closedir(DIR);
     }




Next Copyright © 2002 M. J. Dominus