From owner-freebsd-questions@FreeBSD.ORG Thu Jun 14 06:11:08 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D41FD106566C for ; Thu, 14 Jun 2012 06:11:08 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 90E438FC0C for ; Thu, 14 Jun 2012 06:11:08 +0000 (UTC) Received: from r56.edvax.de (port-92-195-40-10.dynamic.qsc.de [92.195.40.10]) by mx01.qsc.de (Postfix) with ESMTP id DADA53D23B; Thu, 14 Jun 2012 08:11:07 +0200 (CEST) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id q5E6B7dE001986; Thu, 14 Jun 2012 08:11:07 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Thu, 14 Jun 2012 08:11:07 +0200 From: Polytropon To: grarpamp Message-Id: <20120614081107.c0439718.freebsd@edvax.de> In-Reply-To: References: Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: `ls -l` shows size of file other than of the folder? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2012 06:11:08 -0000 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, ...