From: Raf Coremans Date: 2007-08-03T06:41:37+09:00 Subject: Re: Directory lstat mass listing ------=_Part_90114_28076537.1186090895030 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline 2007/8/2, Jon Hawkins : > > Been trying to get a full list of file sizes out of a directory > structure, starting from '/' ... The code below wont work because the > method doesnt accept wildcards, and instead gives the size of the > directory block rather than the file sizes within it. > > Dir.chdir('/') > > File.size("**/**").each {|x| puts x} > > > and the problem with File.size("/.") is that it list the size of the > directory > block size '4096' > > i was thinking that somehow i could run a directory surf with the > Find.find method > --- Find.find("/", "./") {|path| puts path} --- > and shove that data into an array, then run File.size on each array item > with a range... anyone have any ideas? > -Thanks > -- > Posted via http://www.ruby-forum.com/. > > I can suggest this: Dir.glob( "**/*").each{ |f| puts File.size( f) if File.file?( f)} Regards, Raf ------=_Part_90114_28076537.1186090895030--