Weird file sizes in Finder

Joined
Jan 21, 2012
Messages
24
Reaction score
0
Points
1
In Finder, I have the "Install Xcode.app" file which is 1.81 GB. I told Finder to duplicate it, and it created a "Install Xcode copy.app" file that is only 1.57 GB. Why isn't the duplicate the same size as the original?

Then I did a Get Info on the original, and it said the size is "1,814,588,172 bytes (1.81 GB on disk)". Then I did a Get Info on the duplicate, and it said the size is "1,570,347,315 bytes (1.81 GB on disk)". Why do both of them say "1.81 GB on disk" but then the number of bytes is different for each one?

I am running Lion 10.7.2.
 
Joined
Jul 30, 2009
Messages
7,295
Reaction score
301
Points
83
Location
Wisconsin
Your Mac's Specs
Mac Mini (Late 2014) 2.6GHz Intel Core i5 Memory: 8GB 1600MHz DDR3
More important (seeing how I don't know why) is whether the copy works just as well as the original.
 
OP
S
Joined
Jan 21, 2012
Messages
24
Reaction score
0
Points
1
It turns out that .app files are actually directories. I'm new to Macs, so I didn't know that.

Now I just installed DeltaWalker (a program that lets you do a diff on files/folders), and it says that the "Install Xcode.app" directory is exactly the same as the "Install Xcode copy.app" directory. They both have the same files and subdirectories, and all of the content/data within all of the files are exactly the same.

So it looks like the duplication worked perfectly, but there's a bug in Finder. It is not reporting the size of the "Install Xcode copy.app" correctly. For some reason it thinks it is a different size than "Install Xcode.app", even though they are both exactly the same.
 
Joined
Sep 30, 2007
Messages
9,962
Reaction score
1,235
Points
113
Location
The Republic of Neptune
Your Mac's Specs
2019 iMac 27"; 2020 M1 MacBook Air; macOS up-to-date... always.
Interesting question. I just tried this with a different application and though it is smaller, I had the same result… a different reported size on the copy. What's even weirder… I repeated it a few times and got very different file sizes each time.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
So, I wanted to try this as well. I have an interesting result:

finder_sizes.jpg

That may not look interesting but Chrome Canary is listed as being 218.4MB in my /Applications folder. So, I can copy it over to my user one, have it report a different size but do so for every copy that I make. Now, it gets more interesting when I move these files over to the Trash and then back to ~/Applications. When I do that, Chrome Canary is correctly reported as 218.4MB.
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
Hey vansmith. What does it report as a du ?
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Tried that earlier and noticed that it was fairly consistent with the Finder values so I didn't post it. However, I tried it again and got some interesting results:

No code has to be inserted here.

I have no idea how Finder calculates directory sizes but however it does it, it doesn't do it consistently.
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
Tried that earlier and noticed that it was fairly consistent with the Finder values so I didn't post it. However, I tried it again and got some interesting results:

No code has to be inserted here.

I have no idea how Finder calculates directory sizes but however it does it, it doesn't do it consistently.

Ok, that's bizarre. I could accept that du uses base 2 calculation (it does) and finder uses base 10 (which it also does), but the discrepancy is FAR too large for that.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
This is why I didn't post the initial discrepancies (base-2/base-10 differences) but I'm bothered by these new ones. What's just as disconcerting is Finder's inconsistency. I copied the same app bundle to the same location seconds apart and it calculated three different sizes which aren't even close to each other.
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
My conclusion:

Finder is borked, use du.

That's just me though ;)
 
OP
S
Joined
Jan 21, 2012
Messages
24
Reaction score
0
Points
1
Interesting question. I just tried this with a different application and though it is smaller, I had the same result… a different reported size on the copy. What's even weirder… I repeated it a few times and got very different file sizes each time.

Yes I got that to happen too with the GarageBand.app. So far I've only seen this file size discrepancy happen with duplicated apps - every other actual file I've duplicated shows the same size as the original.

My conclusion:

Finder is borked, use du.

du also has problems. Here is some du output where it shows different sizes for the original and duplicate:
Code:
Slapples-MacBook-Pro:~ Administrator$ du -k /Applications/Install\ Xcode.app/
0	/Applications/Install Xcode.app//Contents/_CodeSignature
8	/Applications/Install Xcode.app//Contents/_MASReceipt
16	/Applications/Install Xcode.app//Contents/Library/LaunchServices
16	/Applications/Install Xcode.app//Contents/Library
68	/Applications/Install Xcode.app//Contents/MacOS
16	/Applications/Install Xcode.app//Contents/Resources/ASIInstallStepsView.nib
8	/Applications/Install Xcode.app//Contents/Resources/ASIServiceLevelAgreementView.nib
0	/Applications/Install Xcode.app//Contents/Resources/ASIWindow.nib
12	/Applications/Install Xcode.app//Contents/Resources/en.lproj/MainMenu.nib
32	/Applications/Install Xcode.app//Contents/Resources/en.lproj
1769088	/Applications/Install Xcode.app//Contents/Resources/Packages
0	/Applications/Install Xcode.app//Contents/Resources/Xcode.mpkg/Contents/Plugins
36	/Applications/Install Xcode.app//Contents/Resources/Xcode.mpkg/Contents/Resources/English.lproj
384	/Applications/Install Xcode.app//Contents/Resources/Xcode.mpkg/Contents/Resources
384	/Applications/Install Xcode.app//Contents/Resources/Xcode.mpkg/Contents
384	/Applications/Install Xcode.app//Contents/Resources/Xcode.mpkg
1771768	/Applications/Install Xcode.app//Contents/Resources
1771864	/Applications/Install Xcode.app//Contents
1771864	/Applications/Install Xcode.app/
Slapples-MacBook-Pro:~ Administrator$ du -k /Applications/Install\ Xcode\ copy.app/
8	/Applications/Install Xcode copy.app//Contents/_CodeSignature
8	/Applications/Install Xcode copy.app//Contents/_MASReceipt
60	/Applications/Install Xcode copy.app//Contents/Library/LaunchServices
60	/Applications/Install Xcode copy.app//Contents/Library
188	/Applications/Install Xcode copy.app//Contents/MacOS
20	/Applications/Install Xcode copy.app//Contents/Resources/ASIInstallStepsView.nib
12	/Applications/Install Xcode copy.app//Contents/Resources/ASIServiceLevelAgreementView.nib
4	/Applications/Install Xcode copy.app//Contents/Resources/ASIWindow.nib
16	/Applications/Install Xcode copy.app//Contents/Resources/en.lproj/MainMenu.nib
80	/Applications/Install Xcode copy.app//Contents/Resources/en.lproj
1769088	/Applications/Install Xcode copy.app//Contents/Resources/Packages
4	/Applications/Install Xcode copy.app//Contents/Resources/Xcode.mpkg/Contents/Plugins
120	/Applications/Install Xcode copy.app//Contents/Resources/Xcode.mpkg/Contents/Resources/English.lproj
472	/Applications/Install Xcode copy.app//Contents/Resources/Xcode.mpkg/Contents/Resources
504	/Applications/Install Xcode copy.app//Contents/Resources/Xcode.mpkg/Contents
504	/Applications/Install Xcode copy.app//Contents/Resources/Xcode.mpkg
1771948	/Applications/Install Xcode copy.app//Contents/Resources
1772228	/Applications/Install Xcode copy.app//Contents
1772228	/Applications/Install Xcode copy.app/
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
That seems to conflict with my findings. I saw consistent values with du (as you can see above).

I'm not saying you're wrong. Rather, it would seem that the problem is hard to reproduce with any consistency. I wonder what the problem is here.
 
OP
S
Joined
Jan 21, 2012
Messages
24
Reaction score
0
Points
1
Your du values only say 209MB. What are the actual du values down to the bytes?
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
The small difference in filesizes in du can be attributable to things like.. sparse files, directory restructuring, etc The 100+ MB differences Van had.. can't.
 
OP
S
Joined
Jan 21, 2012
Messages
24
Reaction score
0
Points
1
The small difference in filesizes in du can be attributable to things like.. sparse files, directory restructuring, etc

But since I duplicated it, wouldn't the duplicate have the same sparse files, directory restructuring, etc.? So the du for both the original and duplicate should be exactly the same.

But here's another example - I did a du on the GarageBand.app and the duplicate I made. The difference for those is significant - du says the duplicate is almost 2x as large as the original:

Code:
du -k /Applications/GarageBand.app/
212868	/Applications/GarageBand.app/

du -k /Applications/GarageBand\ copy.app/
397880	/Applications/GarageBand copy.app/
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
Not necessarily, I've seen MUCH larger file sizes outa du in some instances, take the following for example:


Method of copy can cause discrepancy.

I used cp -rp for the copy process.

Mikes-iMac:~ mike$ du -sk /Applications/Adium.app/; du -sk ~/Adium.app/
70488 /Applications/Adium.app/
143900 /Users/mike/Adium.app/
Mikes-iMac:~ mike$ find /Applications/Adium.app/ |wc -l;find ~/Adium.app/ |wc -l
3522
5766

So we missed ended up with more files in the copy. Interesting, isn't it?


I use cp -av and get..

Mikes-iMac:~ mike$ du -sk /Applications/Adium.app/; du -sk ~/Adium.app/
70488 /Applications/Adium.app/
70488 /Users/mike/Adium.app/
Mikes-iMac:~ mike$ find /Applications/Adium.app/ |wc -l;find ~/Adium.app/ |wc -l
3522
3522

and it's identical. Now, if you really wanted to compare, you could take the ls -lR output, pipe that to files.. edit the files (sed and awk are your friends) to reduce the discrepancies (directory names etc), and then diff the output. I'm too tired to come up with that statement at the moment :)
 
OP
S
Joined
Jan 21, 2012
Messages
24
Reaction score
0
Points
1
So the "du" for your "cp -rp" reported the same for both dirs, even though one dir has a lot more stuff than the other dir. That seems to be the opposite of what I saw, where the du was different for 2 dirs, even though both dirs are the same.

But I think we are in agreement that Finder and du are not consistently reporting directory sizes correctly? Seems like a bug in Mac OS X.
 
Joined
Mar 17, 2008
Messages
6,879
Reaction score
191
Points
63
Location
Tucson, AZ
Your Mac's Specs
Way... way too many specs to list.
No, du reported that the copy was almost twice the size for the cp -rp method.
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Your du values only say 209MB. What are the actual du values down to the bytes?
I get consistent values for each bundle:
Code:
~/Applications :: du -sk Google\ Chrome\ Canary.app/
214524	Google Chrome Canary.app/
~/Applications :: du -sk Google\ Chrome\ Canary\ 2.app/
214524	Google Chrome Canary 2.app/
~/Applications :: du -sk Google\ Chrome\ Canary\ 3.app/
214524	Google Chrome Canary 3.app/
That's not all that surprising though since my first use of du reported similar findings. While I used megabyte level values (which would remove some precision), I didn't expect the difference you saw since, even with rounding, the values would have been drastically different. In other words, I'm willing to bet that if you did a "du -skh" on those bundles, you'd see values similar to 208MB and 389MB. If my differences were that great, I probably would have moved down the "size level" for more precision. ;)
 
Joined
Sep 30, 2007
Messages
9,962
Reaction score
1,235
Points
113
Location
The Republic of Neptune
Your Mac's Specs
2019 iMac 27"; 2020 M1 MacBook Air; macOS up-to-date... always.
Ok, I'm trying a little experiment. Using LibreOffice, I made a series of zip files to see if those files change, and what happens when I unzip them.

LibreOffice: 436.5 MB; copy of this: 363.8 MB
LibreOffice (zipped): 171.4 MB, made 3 zips files, all stayed the same.
LibreOffice (copy of zipped): 171.4 MB
LibreOffice (unzipped): 436.5 MB

It looks to me like Finder is adding some sort of metadata inside the directory structure of apps (after all, apps are really special folders), and copy/pasting the app doesn't include that metadata. The zip files remain unaffected because they are a true single file. Perhaps it's an index for Spotlight?

EDIT: I'll have to try this later since LO has been updated to a newer version than what I have, but I'm curious to see if the file size changes after LO has been on my hard drive for a bit by comparing it against the original download before extracting it from the DMG file.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top