Re: g_format_file_size_for_display()
- From: "Brian J. Tarricone" <bjt23 cornell edu>
- To: gtk-devel-list gnome org
- Subject: Re: g_format_file_size_for_display()
- Date: Tue, 18 Dec 2007 16:20:01 -0800
David Zeuthen wrote:
Ideally this one needs to take another parameter indicating whether you
want 1kb = 1000 bytes or 1kb = 1024 bytes.
The reason is that we want to generate nice display names in the volume
monitor; for ordinary media you want 1000 (to match the label on the
media); for optical discs you normally want 1024. gnome-vfs has this
terrible bug where it uses 1024 so you get the label "61.2 MB" media
even when the media itself says 64MB. This is kinda like punching the
user right in the face. It's not a mistake we should make for the new
shiny gvfs stuff.
Mistake? That's correct behavior. It's not our fault the storage
companies lie and use base-10 kB/MB/GB when everyone else uses base-2,
and in fact they've been successfully sued in the US for doing this.
Reporting the *actual* size of the media in base-2 units is the right
way to go everywhere.
Whether to use traditional kB/MB/GB or the (IMO somewhat ridiculous) SI
KiB(which breaks the normal lowercase k = kilo convention for no
reason)/MiB/GiB is another discussion. (I'd vote no in that discussion,
at any rate.)
-brian
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]