Why there are differences between files sizes in Nautilus in Ubuntu 12.04 and Ubuntu 10.04?

Asked by Nicola Jelmorini

An image can explain better than a lot of words, so at this link [http://ubuntuone.com/1IIRoVCf3dP2l8YQkXs5RN] you can download a screenshot of my PC with Nautilus running.
On the left of the image there is Nautilus on Ubuntu 12.04, and on the right there is Nautilus on Ubuntu 10.04. As you can see, there is the majority of the files that is listed with a different size between Ubuntu 12.04 and Ubuntu 10.04.
Can you help me understand why?

Thank you

Question information

English Edit question
Ubuntu nautilus Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Revision history for this message
Best Chris (fabricator4) said :

Technically, the 10.04 is reporting the size correctly. You'll see that the real size as given in bytes is the same in both examples - 467,796 bytes. 10.04 is reporting the correct size since a kilobyte is actually 1024 bytes (10000000000 in binary). Hence, 467796/1024=456.8 bytes rounded to the first decimal place for brevity.

The KB reported by Nautilus under 11.04 is simply the bytes divided by 1000, resulting in the answer of 467.8 also rounded to the first decimal place.

There's nothing new in this, because hard drive manufacturers have been doing it for years - at least since the 80's that I know of for sure. eg a 500GB drive is actually 500,000,000,000 bytes, or 465.6 real GB

While the purists may be upset with applying a simple base10 decimal shift to what is essentially a binary system there's no doubt that it will actually make more sense to the average user. The main thing is to understand how the figures are being represented, and not to get too caught up in the rights and wrongs of it.

Both figures mean the same thing - just the representation of it is different. Like I said hard drive manufacturers have been doing it for years, and the sky didn't fall down. ;-)


Revision history for this message
Nicola Jelmorini (jelmorini) said :

Ok. Thank you. Now it's clear even to me that it's only a matter of "base10".
Well, here in Europe we use since ever the base10 for everything, so it's not a problem at all :-)

Revision history for this message
Nicola Jelmorini (jelmorini) said :

Thanks Chris, that solved my question.

Revision history for this message
arunj (engineerarun) said :

Hi Chris,

Is it possible to get back the 1024 base by any tweak? Otherwise is there any chance that you cna provide a settings option in nautilus to use the actual size (to the base 1024) or to the base 10? You have cited the example of what hardware manufacturers were doing for ages. But in case of software I have seen this difference in size only in pcmanfm and now nautilus. When we buy a drive we always find that the actual space is less than advertised but we live with it because we do not need to deal with the size of the hard disk regularly. We know our limit once we format it and add up the partition sizes. But because of the change in nautilus I have all the file sizes increased. So the same file that my friend has on Mac or Windows is different in size! And I have no way to calculate the actual (and correct) size without doing a ll. Another practical problem: Gmail limits the size of attachment to 20MB. When I want to upload a file which shows more than 20Mb in nautilus again I need to do a ll -h.

I understand you can still downplay these issues. But users have to deal with incorrect size everyday because of this change.

Revision history for this message
arunj (engineerarun) said :

A small typo correction: (to the base 1024) or to the base 1000?

Revision history for this message
Chris (fabricator4) said :

Since Nautilus uses 'divide by 1000' instead of 'divide by 1024' it will help you stay under the 20Mb limit, (and the the gmail limit is now 25Mb). What do gmail mean by this however?

Well actually, if they follow conventions they may really mean 25,000,000 bytes because (a) it makes the size look larger and (b) that is what most average users think of as "25 Mb". I didn't find any mention that the limit is really 26,265,625 bytes (25 real Mb). Also read the fine print - the 25Mb includes the attachement, the message, and all of the overhead involved in the encoding of the attachement, and probably the header as well. If you expect to send an actual attachement of 25,000,000 bytes then there's a good chance it will bounce.

No, there's no switch or tweak that will change this in Nautilus, except to change the source code and compile it yourself. As I just stated though, I think you'll find that gmail means 25,000,000, not really 25Mb.

There's also much better ways of verifying that a file was transferred correctly. The rounded size of a large file is only the mearest approximation of accuracy - no guarantee that the file was transmitted correctly. For binaries or anything requiring absolute accuracy you should be sending the md5sum or an equivalent checksum with the file in question, or using an archive wrapper that includes a checksum during unpacking.


Revision history for this message
arunj (engineerarun) said :

Gmail attachment was just an example. But I understand that no switch will be provided for this. I can modify and recompile the source but then I will need to do it whenever there is an update. Thanks for your reply anyway :).