Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Jun 2012 08:11:07 +0200
From:      Polytropon <freebsd@edvax.de>
To:        grarpamp <grarpamp@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: `ls -l` shows size of file other than of the folder?
Message-ID:  <20120614081107.c0439718.freebsd@edvax.de>
In-Reply-To: <CAD2Ti2-%2BD1og9TS8E-vJO2fPg77SRGW%2BXq6bFq0kpOnR=fs0aw@mail.gmail.com>
References:  <CAD2Ti2-%2BD1og9TS8E-vJO2fPg77SRGW%2BXq6bFq0kpOnR=fs0aw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 13 Jun 2012 22:33:50 -0400, grarpamp wrote:
> > The following creates a file with a size of 1024000002 (a gig)
> > fseek(stdout, 1000000*1024, SEEK_END);
> 
> Nope :) What you have there is not actually called (anything).

It would maybe be called a MKiB. :-)



> A proper gibibyte = GiB = 2^30 = 1024^3 = 1073741824
>  for data storage, ram (binary bit handling)
> A proper gigabyte = GB = 1E9 = 1000^3 = 1000000000
>  for data transmission (packet counting, rocketships)
> 
> There be current standards, please use them.
> 
> https://en.wikipedia.org/wiki/Binary_prefix
> https://en.wikipedia.org/wiki/ISO/IEC_80000
> http://www.swedeteam.com/kibi/

In IT context, already in the 60's and 70's, unit prefixes
k, M and G always were interpreted as of 2^n (or 1024*),
even if the unit was _words_, not bytes. :-)

Even school taught that in the 80's: When dealing with
computers, 1 kB != 1000 B, but 1 kB = 1024 B. That is
considered basic knowledge.

Every IT person should be aware of this. It's common to "abuse"
the SI units with the (known!) deviant interpretation.

Sometimes, you find hardware vendors "forgetting" the factor
mismatch 1024 vs. 1000 when they tell you how many GB the new
shiny hard disk has. :-)




-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



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