From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 6 23:29:56 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3D18B106566B for ; Tue, 6 Mar 2012 23:29:56 +0000 (UTC) (envelope-from lgusenet@be-well.ilk.org) Received: from asbnvacz-mailrelay01.megapath.net (asbnvacz-mailrelay01.megapath.net [207.145.128.243]) by mx1.freebsd.org (Postfix) with ESMTP id F15038FC08 for ; Tue, 6 Mar 2012 23:29:55 +0000 (UTC) Received: from mail1.sea5.speakeasy.net (mail1.sea5.speakeasy.net [69.17.117.39]) by asbnvacz-mailrelay01.megapath.net (Postfix) with ESMTP id 40717A71A36 for ; Tue, 6 Mar 2012 18:06:01 -0500 (EST) Received: (qmail 18380 invoked from network); 6 Mar 2012 23:06:00 -0000 Received: by simscan 1.4.0 ppid: 26565, pid: 273, t: 0.2833s scanners: clamav: m: Received: from unknown (HELO be-well.ilk.org) ([66.92.78.145]) (envelope-sender ) by mail1.sea5.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 6 Mar 2012 23:06:00 -0000 Received: from lowell-desk.lan (lowell-desk.lan [172.30.250.8]) by be-well.ilk.org (Postfix) with ESMTP id D248B33C1E; Tue, 6 Mar 2012 18:05:51 -0500 (EST) Received: by lowell-desk.lan (Postfix, from userid 1147) id 2CCFD3985E; Tue, 6 Mar 2012 18:05:51 -0500 (EST) From: Lowell Gilbert To: David Wolfskill To: freebsd-hackers@freebsd.org References: <20120306204101.GE1730@albert.catwhisker.org> Date: Tue, 06 Mar 2012 18:05:51 -0500 In-Reply-To: <20120306204101.GE1730@albert.catwhisker.org> (David Wolfskill's message of "Tue, 6 Mar 2012 12:41:01 -0800") Message-ID: <44fwdlz5ww.fsf@lowell-desk.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailman-Approved-At: Tue, 06 Mar 2012 23:33:19 +0000 Cc: Subject: Re: mtree(8) reporting of file modes X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-hackers@freebsd.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 23:29:56 -0000 David Wolfskill writes: > * mode is set to the (masked) mode of the (immediately) enclosing > directory when it is visited in pre-order. (This is done in statd().) Not quite. It looks like when statd() is called on the enclosing directory itself, it walks all of the children to find the most common values, and issues a "/set" line to establish defaults. When it is subsequently called for each of the children in their own right, it only needs to list the properties that differ. Which isn't really illogical: it substantially reduces the size of the output (and vastly improves the readability-by-humans) in exchange for having to traverse the list of file entries twice. > Maybe I'm confused, but certainly for my present purposes, and likely in > general, I'd think it would make sense to just always report the file > mode. > Another alternative, in case there are use cases for the existing > behavior, would be to provide either another "key" or a command-line > flag that says "give me all the modes". > Am I the only one who would find such a change useful? Well, it's definitely only useful if you're using something besides mtree itself to parse the output file. I like having the defaults, because most of the time all of the files in a directory have the same permissions, and there are fewer distractions for my eye. I guess the question is why do *you* find the "/set" lines to (even just occasionally) not be useful? Be well.