From: "J. D." Date: 2004-11-11T14:03:29+09:00 Subject: Is this a ruby bug? In the following code, the line marked #bad# only finds '.' and '..' directories. But the line marked #good# finds all the subdirectories. I tested this in the same directory, passing the same argument (even so far as using the UP arrow key to avoid typo differences). Is this a bug in Ruby 1.8.2 snapshot? Should the two lines produce the same results? 8<-------- #ruby def dirloop(rootdir) #bad# Dir.foreach(rootdir){|dir| #good# Dir[rootdir + "/**/*"].each{|dir| if(FileTest.directory?(dir)) then puts "found directory #{dir}"; end } end rootDir = ARGV[0]; puts "starting at root directory #{rootDir}"; dirloop(rootDir);