`ls -l` shows size of file other than of the folder?

Polytropon freebsd at edvax.de
Thu Jun 14 06:11:08 UTC 2012


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, ...


More information about the freebsd-questions mailing list