From: Markus Prinz Date: 2009-02-27T18:46:22+09:00 Subject: Re: Why does Dir#glob("**/*") miss dot directories? On 27.02.2009, at 10:34, timr wrote: > So is there a way to get glob to additionally look inside > of .directories? Yes, by specifying File::FNM_DOTMATCH as the second argument: ruby -e 'Dir.glob("**/*.rb", ile::FNM_DOTMATCH)' > Alternatively, if you know of another pure and elegant way of finding > all files recursively, even in dot directories perhaps with File or > something, I would greatly appreciate an example. Maybe this is what you're looking for? From the Find documentation (http://www.ruby-doc.org/stdlib/libdoc/find/rdoc/index.html ): require 'find' total_size = 0 Find.find(ENV["HOME"]) do |path| if FileTest.directory?(path) if File.basename(path)[0] == ?. Find.prune # Don't look any further into this directory. else next end else total_size += FileTest.size(path) end end g, Markus