Adding up megabytes

Posted by: tanstaafl.

Adding up megabytes - 08/09/2009 20:17

I have a folder "A", with 24 folders "B" under it, each of those 24 folders having anywhere from 1 to 21 folders "C" under it. Each of the final layer of folders (the "C" folders) contains anywhere between one and 26 files, for a total of 83 folders (84 counting the top level "A" folder) and 577 files.

In Windows Explorer, I carefully hovered the mouse over each of the "C" folders to get the size of the folder and entered the number of megabytes into an Excel spreadsheet and summed them. The total in the Excel sheet differs by about 2.5% from what I get if I hover the mouse over the "A" folder. (Excel says 28.2 GB, Windows says 27.5 GB.) While 2.5% isn't a lot, it still amounts to 700 megabytes, more disk space than my first four or five computers had -- COMBINED.

I know that the more files I have, the more partially empty sectors there will be, but I thought that hovering over the "C" folders would take that into account.

Why doesn't the sum of the individual "C" folders add up to the total shown for the "top" "A" folder in the tree?

tanstaafl.

Posted by: tfabris

Re: Adding up megabytes - 08/09/2009 20:32

Because the larger numbers you're adding together are ROUNDED NUMBERS, the rounding errors can tend to pile up a bit.

And yes, the entire disk size of your old computer falls within the rounding error margin of your new computer. That's the disk version of Moore's law for ya.
Posted by: peter

Re: Adding up megabytes - 08/09/2009 20:33

2.5% is suspiciously the difference between 1000 and 1024. Windows counts in binary MB and GB. How did you convert your Excel total in MB into GB?

Peter
Posted by: wfaulk

Re: Adding up megabytes - 08/09/2009 23:25

Out of curiosity, what led you to compare these numbers?
Posted by: gbeer

Re: Adding up megabytes - 09/09/2009 00:34

Don't forget the difference between filesize and the filesize rounded up to the next allocation unit.

10 files times 1 byte each = 10 bytes
10 files times 4096 byte allocation unit = 40.960 Kbytes
Posted by: Shonky

Re: Adding up megabytes - 09/09/2009 02:59

Originally Posted By: peter
2.5% is suspiciously the difference between 1000 and 1024. Windows counts in binary MB and GB. How did you convert your Excel total in MB into GB?

Peter

Well he did say megabytes and then later compared in gigabytes so I think you're right.

As long as the "size" or "size on disk" quantities weren't interchanged that shouldn't make a difference.
Posted by: tanstaafl.

Re: Adding up megabytes - 10/09/2009 00:15

Originally Posted By: peter
2.5% is suspiciously the difference between 1000 and 1024. Windows counts in binary MB and GB. How did you convert your Excel total in MB into GB?

Peter


That's it, I think. I added up all those megabytes that Windows said each folder contained, and figured that 28,175 megabytes must be 28.2 gigabytes.

I knew better than that... I just had it in my head that since Windows was providing me with all the number that they would add up, which they do, of course. What caught me out was not thinking through the implications of Windows displaying the grand total in gigabytes but the subtotals in megabytes.

Doh!

tanstaafl.
Posted by: tanstaafl.

Re: Adding up megabytes - 10/09/2009 00:22

Originally Posted By: wfaulk
Out of curiosity, what led you to compare these numbers?


Figuring how many DVD's it would take to back up the files, and how many (and which) files would go on each DVD.

Even though the DVD nominally holds 4489 MB, I have found that (with my burner, at least) anything over 4000 MB greatly increases the chances of creating coasters, so I allocate the files so as to fill up about 3900 MB.

tanstaafl.