From owner-freebsd-current@FreeBSD.ORG Sat Jan 15 19:09:49 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6CD1816A4CE; Sat, 15 Jan 2005 19:09:49 +0000 (GMT) Received: from kientzle.com (h-66-166-149-50.snvacaid.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D94943D49; Sat, 15 Jan 2005 19:09:48 +0000 (GMT) (envelope-from kientzle@freebsd.org) Received: from freebsd.org (p54.kientzle.com [66.166.149.54]) by kientzle.com (8.12.9/8.12.9) with ESMTP id j0FJ9lOZ037612; Sat, 15 Jan 2005 11:09:48 -0800 (PST) (envelope-from kientzle@freebsd.org) Message-ID: <41E96A7B.3010400@freebsd.org> Date: Sat, 15 Jan 2005 11:09:47 -0800 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20031006 X-Accept-Language: en-us, en MIME-Version: 1.0 To: David Schultz References: <200501120735.j0C7ZABq048856@repoman.freebsd.org> <41E5ED66.4070902@freebsd.org> <20050113072153.GA28485@VARK.MIT.EDU> <41E716F3.20504@freebsd.org> <20050114064806.GA10856@VARK.MIT.EDU> In-Reply-To: <20050114064806.GA10856@VARK.MIT.EDU> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: "'freebsd-current@freebsd.org'" cc: Pawel Jakub Dawidek Subject: Re: fts improvements, alternatives X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Jan 2005 19:09:49 -0000 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