Re: fts improvements, alternatives

From: Tim Kientzle <kientzle_at_freebsd.org>
Date: Sat, 15 Jan 2005 11:09:47 -0800
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
Received on Sat Jan 15 2005 - 18:09:49 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:26 UTC