Re: g_format_file_size_for_display()



On Tue, 2007-12-18 at 16:45 -0500, David Zeuthen wrote:

> char *g_format_file_size_for_display (goffset size);
> 
> Ideally this one needs to take another parameter indicating whether you
> want 1kb = 1000 bytes or 1kb = 1024 bytes. 

No, because then you'll have applications using either, and then someone
will want to make them consistent and we'll get an option in the control
center an an XSETTING, which is yet another thing we'll have to port
over when moving from GConf to DConf, and it's just a big fat mess.

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

Big deal :)  When you see 61.2 MB you think, "oh, file system overhead!
ripples in the time-space continuum".  Nobody cares about that.

Back to my original question:  should this function be called
g_format_size_for_display()?  It's not for files only.

[Who's the nitpicker: the one who asks for file sizes versus general
sizes or the one who asks about SI units vs. computer units...]

  Federico




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]