From owner-freebsd-current@FreeBSD.ORG Mon Sep 9 23:51:25 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A20167E8; Mon, 9 Sep 2013 23:51:25 +0000 (UTC) (envelope-from christos@zoulas.com) Received: from rebar.astron.com (rebar.astron.com [208.77.212.97]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7F8E52C7A; Mon, 9 Sep 2013 23:51:25 +0000 (UTC) Received: by rebar.astron.com (Postfix, from userid 10080) id 4A9C997129; Mon, 9 Sep 2013 23:51:22 +0000 (UTC) From: christos@zoulas.com (Christos Zoulas) Date: Mon, 9 Sep 2013 19:51:22 -0400 In-Reply-To: <86zjrleg4h.fsf@nine.des.no> from =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= (Sep 10, 1:21am) Organization: Astron Software X-Mailer: Mail User's Shell (7.2.6 beta(4.pl1)+dynamic 20000103) To: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= Subject: Re: [PATCH] mtree should not output size if the file is not a regular file Message-Id: <20130909235122.4A9C997129@rebar.astron.com> X-Mailman-Approved-At: Tue, 10 Sep 2013 01:27:55 +0000 Cc: FreeBSD Current , d@delphij.net, Brooks Davis , Tim Kientzle X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Mon, 09 Sep 2013 23:51:25 -0000 On Sep 10, 1:21am, des@des.no (=?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?=) wrote: -- Subject: Re: [PATCH] mtree should not output size if the file is not a reg | Roll a large tarball (e.g. a complete FreeBSD installation). Copy it to | different machines with different filesystems. Untar and run mtree on | the result. Notice that you get different output on each machine | because they report different sizes for directories; one might report | the actual on-disk size (which might vary depending on past contents) | while the other might report the number of entries. Yes, I agree. I would like to note that the current NetBSD code looks like: if (keys & F_SIZE && (flavor != F_NETBSD6 || S_ISREG(p->fts_statp->st_mode))) which means that F_NETBSD6 did not print this, and we recently changed it to print the size for compatibility with F_FREEBSD9... We also made the default F_MTREE format to print the size. So I guess the thing to do is change the code to: if (keys & F_SIZE && (flavor == F_FREEBSD9 || S_ISREG(p->fts_statp->st_mode))) christos