bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dd (coreutils) 5.97 used power of 10 not 2 for calculating MB


From: Olivier Delhomme
Subject: Re: dd (coreutils) 5.97 used power of 10 not 2 for calculating MB
Date: Wed, 14 Feb 2007 20:13:03 +0100

Le Tue, 13 Feb 2007 22:18:12 -0800, Paul Eggert disait :

> My kneejerk reaction is that there's a lot of complexity there.  Can't
> we make it simpler?  Why are there so many options?  Normally, for
> example, "human" and "si" are mutually exclusive alternatives, so why
> should one specify both "human" and "si"?

Thank you for your reply,

I agree those options are a bit confusing as are the dd options at first.
Yes "human" and "si" are mutually exclusive alternatives to be used
with the "--dbs" option. 
The "--display" option is here to respond to 3 wishes :

 1. when the option is not used nothing changes
 2. used with "human" parameter the classic output is turned
    into a human readable format
 3. used with "quiet" parameter it turns off the output (stated
    a long time ago here : 
    http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=165045).

So may be the "human" parameter confused you and will confuse others.
I can change this to a "notgeek" parameter ;) May be we can find 
something in between.

> > ./dd if=/dev/zero of=/dev/null bs=512k count=123 display=human dbs=si
> > 65M+0 bytes in
> > 65M+0 bytes out
> > 64487424 bytes (65M) copied, 0,001492 s, 44,0G/s
> 
> Here, the "65M" is repeated.  That seems redundant.  Come to think of

With the patch you can still choose to display this last line or not as
the option "status=noxfer" is still valid.

> it the whole "bytes in/bytes out/bytes copied" thing is redundant.  If
> we're going to change the format, surely there's a better way to
> change it.

Then you could add a new parameter to the "--display" option in order 
to add a new way of displaying the "whole thing".

> Also, why does this style omit the space between the number and the
> units?  The current style has a space there.  That is the usual SI
> style (see <http://www.physics.nist.gov/cuu/Units/checklist.html> and
> look for "space between the numerical value and the unit symbol").  It
> would be more consistent with SI practice to report the quantity as
> "65 MB" and the transmission rate as "44,0 GB/s".  For powers of two
> formats it should be "65 MiB" and "38,0 GiB/s" (or whatever).

Are my patches concerned by this ? I use the functions you did write in
the human.c file. (sorry for this long link below)

http://cvs.savannah.gnu.org/viewcvs/gnulib/lib/human.c?rev=1.34&root=gnulib&view=markup

> > echo $DD_DISPLAY_BLOCK_SIZE
> 
> All other things being equal it's better to avoid environment
> variables for stuff like this.

In fact I was doing this to keep coherence with your code in human.c.
You use getenv and check some block size variable. I was thinking that
one may find useful to set a particular environment variable for dd block
size instead of using continuously the "--dbs" option. Anyway, this is very 
easy to remove and to add it later if necessary.

-- 
Olivier Delhomme : http://blog.delhomme.org/    [fr]

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]