On Wed, 10 Mar 2004, Ian Macdonald wrote: > Hello, > > According to ri, Dir.glob returns false when invoked with a block: > > -------------------------------------------------------------- Dir::glob > Dir.glob( string, [flags] ) => array > Dir.glob( string, [flags] ) {| filename | block } => false > ------------------------------------------------------------------------ > > My observation is that it would be much more useful if the block form > also returned an array, consisting of each filename modified by the > block. I ran into this today and found I had to use the non-block form > with Array#collect. > > Is there a good reason for this method being the way it is? running on a directory with 100,000 files - which we do alot. the construction of array would balloon your process size... -a -- =============================================================================== | EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov | PHONE :: 303.497.6469 | ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328 | URL :: http://www.ngdc.noaa.gov/stp/ | TRY :: for l in ruby perl;do $l -e "print \"\x3a\x2d\x29\x0a\"";done ===============================================================================