From: "Ara.T.Howard" Date: 2005-09-06T08:35:29+09:00 Subject: Re: Help me clean up this method On Tue, 6 Sep 2005, David Brady wrote: > Ara.T.Howard wrote: > >> just thought i'd point out that every solution posted thus far fails in a >> variety of ways when links are considered > > If you have links, you also have du, which IMO is the Right Tool For This > Job: > > total = `du --max-depth=0|cut -f 1`.to_i windows has links - and systems that have du may not have one that supports max-depth. and du reports on file system blocks - not directory sums. this is typically close, but can diverge greatly depending on file system setup and the number of directoriess - since du will report usage for directories too.. harp:~ > mkdir foobar harp:~ > du foobar 4 foobar fyi. -a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | Your life dwells amoung the causes of death | Like a lamp standing in a strong breeze. --Nagarjuna ===============================================================================