News for hackers. Stuff that matters.
Re:Why is 1 GB equal to 10^9 bytes instead of 2^30? by TillE on Sunday April 06, 2014 @05:56AM (#7540446)
Does any operating system or commonly used program report file sizes in terms of 1 GB = 10^9 bytes? As far as I know they all use GiB and MiB, whether they call it that or not.
Re:Why is 1 GB equal to 10^9 bytes instead of 2^30? by kijin on Sunday April 06, 2014 @06:23AM (#7540501)
Linux is all over the place. For example:

    $ dd if=/dev/zero of=/dev/null bs=1M count=1K
    1024+0 records in
    1024+0 records out
    1073741824 bytes (1.1 GB) copied, 0.157131 s, 6.8 GB/s
'dd' interprets command-line arguments "M" and "K" as 2^20 and 2^10 respectively, but when it reports the total amount copied, it uses the decimal GB (10^9). It also uses decimal SI units in the average speed calculation.

My favorite file manager, Thunar, reports file sizes in decimal units. Not sure if it's distro-specific, though.

Many other programs, like 'df', have a switch (--si) that turns decimal units on or off.

Re:Why is 1 GB equal to 10^9 bytes instead of 2^30? by m_mueller on Sunday April 06, 2014 @06:08AM (#7540471)
OSX has switched to 10^9 bytes a few iterations ago.
Re:Why is 1 GB equal to 10^9 bytes instead of 2^30? by twic on Sunday April 06, 2014 @08:24AM (#7540723)
I remember seeing a French Mac many years ago (pre-OS X). I don't know what kind of mega it used (there was no giga back then), but file sizes were reported as "Mo" rather than "MB", for "mega-octets", "octet" being the French word for byte. It sounded much classier to me.

Of course, aficionados of RFCs will know that "octet" is (or at least was) the preferred term for "byte" in IETF documents as well. I don't think this is because the RFC editor was secretly French, although i'm sure he was thoroughly classy; presumably it's because early RFCs were written in the era when the byte had not quite settled down at eight bits, and needed to be unambiguous.

Re:Why is 1 GB equal to 10^9 bytes instead of 2^30? by TillE on Sunday April 06, 2014 @06:49AM (#7540548)
Snow Leopard apparently, which was released in 2009. Ubuntu's policies on the subject seem to be about the same age.

I suppose I should've said that up until five years ago, nearly everyone was using powers of two for file sizes. And Windows/Mac never used the correct prefixes.

Re:Why is 1 GB equal to 10^9 bytes instead of 2^30? by ygra on Sunday April 06, 2014 @07:03AM (#7540575)
http://blogs.msdn.com/b/oldnewthing/archive/2009/06/11/97253...

It's a tricky topic and as Raymond correctly points out, giving people a term that they don't understand probably serves little to no good purpose.

Re:Why is 1 GB equal to 10^9 bytes instead of 2^30? by tatref on Sunday April 06, 2014 @07:17AM (#7540597)
I don't think that giving the users something that _is_ wrong is a better solution... Why not switching to GiB? Power users would understand, and others wouldn't even notice!
Re:Why is 1 GB equal to 10^9 bytes instead of 2^30? by FigBug on Sunday April 06, 2014 @10:00AM (#7540950)
Why not switch to actual GB like the OS X did. I'm not sure why anybody prefers GiB.
Re:Why is 1 GB equal to 10^9 bytes instead of 2^30? by tatref on Sunday April 06, 2014 @10:49AM (#7541114)
Either way, as long as GB = 10^9, and GiB = 2^30
Re:Why is 1 GB equal to 10^9 bytes instead of 2^30? by cnvogel on Sunday April 06, 2014 @01:05PM (#7541555)
It depends, sometimes it's even switchable, e.g. take df.

    $ df -k /
    Filesystem     1K-blocks     Used Available Use% Mounted on
    /dev/sda3      151798672 47602008 102615608  32% /

    $ df -h /
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/sda3       145G   46G   98G  32% /

    $ df -H /
    Filesystem      Size  Used Avail Use% Mounted on
    /dev/sda3       156G   49G  106G  32% /
(-h "human readable" with powers of 2^10, -H "human readable" with powers of 10^3)

$ df --version df (GNU coreutils) 8.22

ls has -h/--si/-k ...

    $ ls -h -l /proc/kcore 
    -r-------- 1 root root 128T Apr  6 19:02 /proc/kcore
    $ ls --si -l /proc/kcore 
    -r-------- 1 root root 141T Apr  6 19:03 /proc/kcore
(/proc/kcore is 2^47 = 140737488355328 = 128 * 2^40 = 128 TiBi bytes)
Re:Why is 1 GB equal to 10^9 bytes instead of 2^30? by tatref on Sunday April 06, 2014 @06:02AM (#7540458)
Windows uses GiB, but displays GB. On Linux, most tools uses standard SI (1000 = K, 1024 = Ki), but not all of them...
Re:Why is 1 GB equal to 10^9 bytes instead of 2^30? by ambrop7 on Sunday April 06, 2014 @06:23AM (#7540502)
XFCE (Thunar) uses SI units (just verified against ls -l).
Re:Why is 1 GB equal to 10^9 bytes instead of 2^30? by paulnechifor on Sunday April 06, 2014 @06:22AM (#7540498)
Nautilus and Thunar (to name a few) in Ubuntu use SI prefixes.