2010-06-06から1日間の記事一覧
http://d.hatena.ne.jp/myokoym/20100425/1272202028の Dir.glob バージョン。 def dir_size(path) expath = File.expand_path(path) sum = 0 Dir.glob("#{expath}/**/*") do |fn| # next if File.directory?(fn) sum += File.stat(fn).size end sum end か…