From: William James Date: 2005-08-01T13:31:03+09:00 Subject: Re: excluding dirs with FileList Joel VanderWerf wrote: > How can I construct a FileList that excludes dirs? Not a particular > directory, but _any_ directory? > > I had hoped that #exclude could be passed an object whose #=== method > returned true for a dir (using File#directory?). But #exclude tries to > turn its argument into a string and build up a regex. > > -- > vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407 list = [] Dir.glob( "*" ){ |f| list << f unless File.directory?(f) } p list