freememapplet_tray v2.8.6 and v2.8.6f - includes source

Core libraries and systems
Message
Author
User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#61 Post by MochiMoppel »

Thank you! I changed the .svg files into symlinks to the old .xpm icons. Even easier: Renaming the .xpm files and letting them masquerade as .svg files. I'm probably breaking some rules here, but I enjoy it :lol:

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#62 Post by gyro »

01micko wrote:If you don't mind, I'd like to make a post in the translations section so we can get some .po files for different languages, or you can do it if you like.
You're welcome to take it and do what you want with it. I'm quite happy to say that I've done all I came to do with freememapplet_tray.

gyro

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

Are we showing the correct number?

#63 Post by gyro »

I've just done a little digging into why partview and freememapplet_tray give such different numbers?
The simple answer is, they use different numbers.

Let me explain:
1) Firstly lets put aside the difference between GB 1000*1000*1000 and GiB 1024*1024*1024, since they both actually use GiB.
2) But which numbers should be used?
There are 2 numbers available for the size, the total size of the partition as seen by probepart, and the size as seen by the filesystem.
There are 2 numbers to use for the free space, the actual number of free blocks or the number available to an unprivileged user.

An example:
I have a 293GiB (approx) ext4 partition.
probepart sees it as 292.97GiB
statfs sees it as 288.25GiB
df shows it as 289G
ROX shows it as 289G
PCManFM shows it as 288.2GiB
partview shows it as 293.0G
freememapplet_tray would show it as 288GiB

statfs says it has 276.53GiB free, and 261.87GiB available
df shows 12G used and 262G available
ROX shows 262G free
PCManFM shows 261.9GiB free
partview shows 281.2 free
freememapplet_tray would show 261GiB

Part of the confusion comes from the difference between "free" and "available". "free" means exactly that, but "available" means the amount of space available to an unprivileged user.
Some file systems reserve some space for use by the OS, so not all the "free" space is available to an unprivileged user.
It's not surprising that the file managers show the "available" number as being free.
df shows "Used" as ("1K-blocks" - "free"), and "Available" as available. That is why ("1K-blocks" - "Used") is larger than "Available".
partview gets a unique "free" number because it subtracts the "Used" number from df from the size number from probepart. Unfortunately I therefore suspect that this number's accuracy is suspect.

So which "size" number should we use?
Which "free" number should we use?

Notes:
It's not difficult to change partview to get any of the numbers by using more of the numbers from df.
Its easy to get frememapplet_tray to use the "free" number instead of the "available" number.
The larger "size" number is not available to freememapplet_tray at the moment.

Ideas??

gyro

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#64 Post by gyro »

The following is a patch to change freememapplet_tray.c to get it to use "free" instead of "available":

Code: Select all

--- freememapplet_tray.orig.c	2015-09-19 09:59:26.448279855 +1000
+++ freememapplet_tray.c	2015-09-23 13:52:11.218923080 +1000
@@ -66,7 +66,7 @@
 	{
 		sizetotal = vfs.f_blocks;
 		sizetotal = (sizetotal * vfs.f_bsize) / 1048576;
-		sizefree = vfs.f_bavail;
+		sizefree = vfs.f_bfree;
 		sizefree = (sizefree * vfs.f_bsize) / 1048576;
 	}
 	else
It's a fairly trivial change to the source.

gyro

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

Version 2.8.6f

#65 Post by gyro »

I have released and alternate version freememapplet-2.8.6f.tar.gz.
The only difference is that the patch from my previous post has been applied. From all the information returned by "statfs", it uses the "free" number instead of the "avail" number.
So if you've applied the patch to version 2.8.6, then there's no point in downloading this one.

Please see first post for download.

gyro

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

Re: Are we showing the correct number?

#66 Post by mavrothal »

gyro wrote: It's not difficult to change partview to get any of the numbers by using more of the numbers from df.
Its easy to get frememapplet_tray to use the "free" number instead of the "available" number.
The larger "size" number is not available to freememapplet_tray at the moment.

Ideas??
I would think that status quo is fine, in the sense that partview is more of a "hardware checking" app and the rest "user information" apps. So would be OK for partview to show "actual" and the rest "usable". Though a little note may be needed in the partview UI to clarify that.
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

Re: Are we showing the correct number?

#67 Post by gyro »

mavrothal wrote:I would think that status quo is fine
If you mean the current "partview" then I would have to disagree.
The "free" number that current "partview" provides seems to be a figment of it's imagination. It should show either the real "free" or the real "available".

Does the "avail" number represent usable space when running as root?
The doco states that this number relates to a non-privileged user.

gyro

User avatar
ASRI éducation
Posts: 3197
Joined: Sat 09 May 2009, 12:10
Location: France
Contact:

Re: freememapplet_tray v2.8.6 and v2.8.6f - includes source

#68 Post by ASRI éducation »

gyro wrote:freememapplet-2.8.6f.tar.gz
Compiled with Puppy Precise 571-woofce.
All seems ok.
Regards,
Projet ASRI éducation => [url=http://asri-education.org/]Association[/url] | [url=http://forum.asri-education.org/]Forum[/url] | [url=http://dl01.asri-education.org/]Dépôt[/url] | [url=http://kids.asri-education.org/]Espace kids[/url]

gyro
Posts: 1798
Joined: Tue 28 Oct 2008, 21:35
Location: Brisbane, Australia

#69 Post by gyro »

@ASRI éducation,
Thanks.
gyro

Post Reply