From: "Suraj N. Kurapati" Date: 2006-08-05T03:52:49+09:00 Subject: Re: Dir.glob finding folders -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Geoff wrote: > Just to follow up, I did try this and it worked. I also want to add > that the reason I was trying to use Dir is because in searching for > solutions to this I found reference to it being faster. I would still > love to hear any feedback on how to optimize this or change the > solution so that it would speed things up. Searching a 60gb hard drive > this way takes a while. :) In that case emulate (or better yet, use GNU/Linux! ;) the behavior of the slocate(1) and updatedb(1) tools on GNU/Linux. The updatedb(1) tool just stores all paths available on your system... like Find.find('/') do |path| puts path end into a text file. Then slocate(1) simply grep(1)s for your query in that text file. This approach is *much* faster because you pre-compute all the paths on your system. Imagine how slow Google would be if they searched the entire WWW instead of searching through a pre-computed index of the WWW! -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQFE05c2mV9O7RYnKMcRAqC0AJ91OfgegI1HBNPcD5nI4gLKUjDwigCgjV7h p6UvRRSKMyG27QqhpNbuxPY= =CQsm -----END PGP SIGNATURE-----