fts improvements, alternatives
    Tim Kientzle 
    kientzle at freebsd.org
       
    Sat Jan 15 11:09:49 PST 2005
    
    
  
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
    
    
More information about the freebsd-current
mailing list