From: Robert Klemme Date: 2009-11-11T18:42:25+09:00 Subject: Re: File size vs. Directory size problem 2009/11/10 Tom Tom : > Sven Schott wrote: >> Maybe something like: >> >> puts File.size(i) unless File.directory?(i) >> >> On Tue, Nov 10, 2009 at 4:47 PM, T.w.oliver@gmail.com Tom < > > I completely missed the directory method haha. Thank you sir. There is also the not so well known method "test" which can be used for this: old_array = Dir["#{old}/**/*"] old_array.each do |f| puts File.size(f) unless test ?d, f end Btw, the original code copied the result of Dir[] into another Array. That seems unnecessary additional work. You can directly use the result of Dir[]. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/