[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Dir.foreach not with patterns?

Weirich, James

9/18/2003 3:50:00 PM

> >> I like the Dir[] form (or its "glob" alternative). I used to write
> >> recursive functions to search a directory tree. Then I discovered
> >> Dir['**/*.rb']. Not only is it easier, it's also faster.
>
> I'm not so sure. I timed my recursive "Filescan" class against Dir[] on
> a large fileserver. Dir[] took 92 seconds, and my Filescan class only
> took 72 seconds.

Hmmm ... Perhaps I implemented the my recursive search in a slow manner.
Care to share your Filescan class?

--
-- Jim Weirich / Compuware
-- FWP Capture Services
-- Phone: 859-386-8855