gdesklets - calculation of disksize

Joe Marcus Clarke marcus at marcuscom.com
Tue Mar 30 14:48:13 PST 2004


On Tue, 2004-03-30 at 17:11, Franz Klammer wrote:
> question to the knowing people:
> 
> gdesklets didn't calculate the correct disk size returned from glibtop.
> i had to change the following lines (excerpt from a diff):
> 
> -        free = float(bfree * 512)
> -        total = float(blocks * 512)
> +        free = float(bfree * 2048)
> +        total = float(blocks * 2048)
>  
> my questions:
> - is this only necessary on -CURRENT?
> - if yes: from which version upwards i should check?

On -CURRENT, we have statvfs, but there are parts of the GNOME code that
don't use it right.  This is why you were seeing weird values in
nautilus previously.  Places where statvfs is used need to be modified
to use the f_frsize member for block size, and f_bavail for available
blocks.

In this case, you also need to make sure that the value given to you
from libgtop2 is using f_blocks and f_bfree.  Then, multiply those
values by whatever you get for f_frsize.

Joe

> 
> franz
> 
> _______________________________________________
> freebsd-gnome at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-gnome
> To unsubscribe, send any mail to "freebsd-gnome-unsubscribe at freebsd.org"
-- 
PGP Key : http://www.marcuscom.com/pgp.asc


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: This is a digitally signed message part
Url : http://lists.freebsd.org/pipermail/freebsd-gnome/attachments/20040330/df16e4cd/attachment.bin


More information about the freebsd-gnome mailing list