From: David Alan Black Date: 2002-01-12T07:24:24+09:00 Subject: Re: Dir.entries have no home Hi -- On Sat, 12 Jan 2002, Dave Thomas wrote: > Ron Jeffries writes: > > > I'm suggesting that the objects involved in the Dir.entries, > > FileTest, and File families aren't quite right. Think of it this > > way: > > and/or... > > The interface to Dir is wrong. Right now, it's basically a wrapper > around system calls. Perhaps it would be better to have something like > > Dir#parent > Dir#subdirectory_names_matching(glob) > Dir#file_names_matching(glob) > Dir#other_names_matching(glob) > Dir#contains_file_named(name) > Dir#path > Dir#remove_files > Dir#remove_sub_directories There's a rejected RCR (from me :-) that proposed a second argument to Dir.glob, that second argument being a filter for Kernel#test. So then you could do: Dir[glob, 'd'] to get directories. As I said, it's been rejected as an RCR, but anyone who wants to see/use the implementation can find it at: http://www.rubygarden.org/article.php?sid=137 David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav