From owner-freebsd-audit Sat Apr 21 6: 6:22 2001 Delivered-To: freebsd-audit@freebsd.org Received: from ringworld.nanolink.com (ringworld.nanolink.com [195.24.48.13]) by hub.freebsd.org (Postfix) with SMTP id BB29837B422 for ; Sat, 21 Apr 2001 06:06:16 -0700 (PDT) (envelope-from roam@ringworld.nanolink.com) Received: (qmail 47955 invoked by uid 1000); 21 Apr 2001 13:04:40 -0000 Date: Sat, 21 Apr 2001 16:04:40 +0300 From: Peter Pentchev To: Joachim Strombergson Cc: FreeBSD-Audit Subject: Re: New du functionality by newbie - audit and comments? Message-ID: <20010421160440.C47557@ringworld.oblivion.bg> Mail-Followup-To: Joachim Strombergson , FreeBSD-Audit References: <3AE065DD.D8FEF0B@ludd.luth.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3AE065DD.D8FEF0B@ludd.luth.se>; from watchman@ludd.luth.se on Fri, Apr 20, 2001 at 06:37:49PM +0200 Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Well, I wouldn't want to be one to pour cold water on others' efforts, but this patch does not seem to be too useful to me :) If you call du(1) with only a single path argument, then the output of -s and -S is nearly identical - with 'total' instead of the path. If you call du(1) with no path arguments, then again, the output of -s and -S is nearly identical, with 'total' instead of '.'. The only difference is there when you call du(1) with more than one path argument. If using -S, only one line shall be output, with the grand total. If using -s, there shall be a line for each path, but no grand total. If using -cs, there shall be a line for each path, *and* a grand total line. This is the only case when your patch matters, but even then, I think using "du -cs | tail -1" does exactly the same job :) And the output saved is not that much - unless you have specified LOTS of paths on the command line, but this isn't such a realistic scenario IMHO. So, sorry to say that, but I really do not think there is much benefit in this :) Other than that.. The patch itself is reversed - when using 'diff' to produce a patch, put the old file first, then the new one. Besides, as Brooks Davis already pointed out, there seem to be a lot of whitespace changes unrelated to the new -S functionality. Still - it's great to see another soul contributing to FreeBSD! G'luck, Peter -- This would easier understand fewer had omitted. On Fri, Apr 20, 2001 at 06:37:49PM +0200, Joachim Strombergson wrote: > Aloha! > > I'm slowly trying to learn the skills needed to start contributing back > to the FreeBSD. And this I guess is my first real shot at it! .-) > > I have for some time missed the ability in the default du to turn off > the interim output, and simply get a grand total at the end. Right or > wrong I decided to add this to the du myself. I have done preliminary > testing on the system, and AFAIK it works as intended. > > Also, some preliminary benchmarks (measuring run times repeated runs on > fairly large parts of the file system) suggests that you do gain a bit > performane by using my silent option (very unsurprising, since I'm > turning off a lot of output) > > The option added is called Silent mode and the flag currently choosen is > -S. > > A unified diff is included with this mail. Any comments, checks and or > suggestions would be appreciated. > > Any possiblilty that a thing like this could/would be added to the > system in due time? To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message