From: Harold Hausman Date: 2007-04-24T09:45:50+09:00 Subject: Re: glob on a dir object On 4/24/07, ruby newbie wrote: > Hi > > I am a Ruby newbie and having fun learning it so far...Can anyone help > me as to why this does not work? > > Why does not glob method work on a Directory object created or am I > not using the OO constrcuts the right way? > Right. The glob method is only available on the Dir class. Observe: C:\>ri Dir#glob Nothing known about Dir#glob C:\>ri Dir::glob -------------------------------------------------------------- Dir::glob Dir.glob( string, [flags] ) => array Dir.glob( string, [flags] ) {| filename | block } => nil ------------------------------------------------------------------------ Returns the filenames found by expanding the pattern given in _string_, either as an _array_ or as parameters to the block. Note that this pattern is not a regexp (it's closer to a shell glob). See +File::fnmatch+ for the meaning of the _flags_ parameter. ... hth, -Harold