On Dec 6, 2007, at 10:49 PM, MonkeeSage wrote: >> >> def each_entry_with_lines >> - glob = File.join param['Directory'].value, '**', '**' >> filters = build_filter_list >> - Dir.glob(glob) do |entry| >> + Find.find param['Directory'].value do |entry| >> next unless filters.match(entry) >> test ?f, entry or next >> lines = IO.readlines entry rescue next >> >> Might I also suggest that you filter on the file's basename? One >> might >> except... >> >> search -F "^\." -a . "blah" >> >> ...to match all dot-files in ./ which contain "blah", but you >> actually >> need something like this since you're running the filter against the >> absolute path... >> >> search -F ".*/*\." -a . "blah" >> >> Regards, >> Jordan > > Testing on a few different directories and filter patterns, the > Find#find version (w/ filters.match(File.basename(entry))) appears to > be about the same a the Dir#glob version for speed (about two tenths > of a second slower for a directory with 2109 files and a filter > pattern of ".*"). > > Regards, > Jordan i'll incorporate something like you suggest and re-release. thanks for the feedback! a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama