Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 21 Apr 2001 16:04:40 +0300
From:      Peter Pentchev <roam@orbitel.bg>
To:        Joachim Strombergson <watchman@ludd.luth.se>
Cc:        FreeBSD-Audit <audit@FreeBSD.ORG>
Subject:   Re: New du functionality by newbie - audit and comments?
Message-ID:  <20010421160440.C47557@ringworld.oblivion.bg>
In-Reply-To: <3AE065DD.D8FEF0B@ludd.luth.se>; from watchman@ludd.luth.se on Fri, Apr 20, 2001 at 06:37:49PM %2B0200
References:  <3AE065DD.D8FEF0B@ludd.luth.se>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010421160440.C47557>