Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Jan 2005 11:09:47 -0800
From:      Tim Kientzle <kientzle@freebsd.org>
To:        David Schultz <das@freebsd.org>
Cc:        Pawel Jakub Dawidek <pjd@freebsd.org>
Subject:   Re: fts improvements, alternatives
Message-ID:  <41E96A7B.3010400@freebsd.org>
In-Reply-To: <20050114064806.GA10856@VARK.MIT.EDU>
References:  <200501120735.j0C7ZABq048856@repoman.freebsd.org> <41E5ED66.4070902@freebsd.org> <20050113072153.GA28485@VARK.MIT.EDU> <41E716F3.20504@freebsd.org> <20050114064806.GA10856@VARK.MIT.EDU>

next in thread | previous in thread | raw e-mail | index | archive | help
David Schultz wrote:
> On Thu, Jan 13, 2005, Tim Kientzle wrote:
>>
>>Here's a snapshot of the current WIP:
>>
>>http://people.freebsd.org/~kientzle/libarchive/src/tree.tgz
> 
> Nice.  That's much cleaner than the fts implementation (although
> it doesn't do all that fts does.)  So tell me again: when did you
> say were you planning on rewriting/fixing fts?  ;-)

I updated the tree.tgz above with a quick sketch of
a "du" based on tree.  A few interesting things I found out:

  * du really requires "pre-descent" and "post-descent" hooks
    for each directory, so I added them to tree.

  * You can actually separate du's size storage from
    the traversal data pretty easily.  I've never
    been entirely comfortable with the fts_number and
    fts_pointer fields on principle; this code
    shows a fairly simple way to avoid them.

  * I just used intmax_t for the size accumulators
    in du.  That seemed the simplest (and most future-proof)
    datatype for the purpose.

Cheers,

Tim



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41E96A7B.3010400>