From: Dave Thomas Date: 2000-03-09T08:19:34-06:00 Subject: [ruby-talk:01791] Re: size of Dir stream The following message is a courtesy copy of an article that has been posted to comp.lang.misc as well. "J.B. Huijsmans" writes: > I've been trying to make a procedure to remove a directory tree. I found > that if I use : > > files=Dir.open(path) > if files.size<=2 # only `.' and '..' > files.close() > Dir.delete(path) > else > ... > end The class method Dir.open returns a Dir object, which (unless things have changed in 1.5) does not respond to 'size'. Possibly you wanted to use Dir.entries, which returns an array of file names. Regards Dave