From: Clement Ow Date: 2008-07-07T16:23:40+09:00 Subject: Re: Getting Folder Size phlip wrote: > Dave Bass wrote: > >> John Joyce wrote: > >>> To explain it a little further... technically, even the system is >>> doing some recursion here when it shows you a folder size. >> >> If you right-click on a large Windows folder such as My Documents and >> select Properties (in XP at any rate) you can see the system recursing >> through and adding up the number of bytes. In theory this figure could >> be made available instantly if the system kept track of what was going >> on in each folder. But presumably that would slow things down (more). > > Right. In terms of transactions, a file system is a database tuned to > rapidly > read and write individual files. Stashing their intermediate sizes - > into every > directory entry in a system - would slow down every single write to > every file, > and nobody wants that. > > Could the original poster attempt what they really need to do, in some > other > way? A spot-check of a limited number of file sizes should be relatively > cheap... Thanks for all your input, guys, really helped me alot! I actually went along with the WIN32OLE method, which is totally sweet especially when you have so many options and lines of code is quite hard to implement a recursive just calculate the file size(i also dont want to compromise on the efficiency of the script) =) Thanks once again! Really nice workin with you guys! =D -- Posted via http://www.ruby-forum.com/.