The first version of libkibi is released. This library is designed for formatting sizes in bytes for display. The user can configure a preferred prefix style. Packages for Debian unstable and Ubuntu 11.04 (maverick) are uploaded.
It contains a README for developers and a byteprefix man page for users, which can be read with
man 5 byteprefix once installed. Thanks to Stefano Rivera for writing the man page!
For a demonstration how this library used by an application can look like, read my previous post.
In this Ubuntu cycle, I work on getting the units policy implemented. For this I wrote a library called libkibi. Here are some screen shots how nautilus looks like with libkibi. Some changes are highlighted in red.
The file properties will show the file size in base10 and base2:
PS: I failed to launch nautilus in English. Therefore the screen shots are in German.
PS²: You can grab the modified nautilus package for Ubuntu 10.10 (maverick) from my experimental PPA (at your own risk!).
Yes, the library is finally called libkibi. The second poll ended with a tie between libbyteprefix (48 votes) and libkibi (45 votes). Then I decided to call the library libkibi.
libkibi is hosted on Launchpad. A working version can be pulled from lp:libkibi with bzr. Please test the library, reports bugs, and ask questions.
Why you should use libkibi instead of g_format_size_for_display (from GLib):
- the users can configure their preferred prefix
- rounds correctly (converting an integer to double, do some math, and then round again leads to rounding errors)
- complies to Ubuntu’s Units Policy (except “historic” is selected)
- is faster (between 15% and 35% depending on the processor)