Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have a disk image which I uploaded to a web server and then downloaded with Safari 5.1 in OS X 10.7.

Finder reports the original as 34,911,334 bytes, and the downloaded file as 34,909,684. Both appear to contain identical contents when mounted.

What's going on here?

Edit: See output of ls -l@ and md5 as suggested:

$ ls -l@
total 136376
-rw-r--r--@ 1 rich  staff  34909684 15 Aug 16:37 Downloaded.dmg
    com.apple.diskimages.fsck         20
    com.apple.diskimages.recentcksum          80
    com.apple.metadata:kMDItemDownloadedDate          53
    com.apple.metadata:kMDItemWhereFroms         144
    com.apple.quarantine          74
-rw-r--r--@ 1 rich  admin  34909684 15 Aug 12:42 Original.dmg
    com.apple.FinderInfo          32
    com.apple.ResourceFork      1650
    com.apple.diskimages.recentcksum          80

$ md5 Original.dmg
MD5 (Original.dmg) = 4c1ed7a85de6ae51479a136ea23ac69e

$ md5 Downloaded.dmg
MD5 (Downloaded.dmg) = 4c1ed7a85de6ae51479a136ea23ac69e
share|improve this question
1  
There are number of ways of reporting the size of the file, and one of them is to show much much space it is taking up, rather than it's actual size - these can be 2 different figures, as data is stored at a block level, not at a byte level, and a block may be any nymber of sizes depending on your filesystem choices. Can you check the filesizes in terminal and send the output? (run Terminal, navigate to the folder the files are stored, eg cd ~/Desktop to move to your users desktop folder, and type 'ls -l' to get a file listing that you can cut(edit)and paste here. –  stuffe Aug 17 '11 at 14:34
1  
If the sum and/or md5 checksums of the files are the same, you are seeing compression in the filesystem. That's likely the cause. –  bmike Aug 17 '11 at 15:07
    
Extra output added. I now have three candidates for what might be causing the different filesizes reported by Finder. How can I figure out which is the culprit? –  Rich Aug 22 '11 at 14:14
1  
This is really a deep question that gets to the heart of the HFS filesystem. Finder apparently counts only the ResourceFork as "belonging" to the file even though all metadata is stored in the filesystem and not in the data fork. (Which made my md5/sum question a good nudge in the right direction, but a bad test of resourceforkness) –  bmike Aug 22 '11 at 18:45
add comment

1 Answer

up vote 5 down vote accepted

The difference of 1650 bytes is probably the result of the resource fork being stripped from the uploaded disk image.

To test, I created a disk image from a folder in Disk Utility. I then used

ls -l@

in the folder that contained the disk image, and it showed the image had a resource fork that was 1650 bytes.

share|improve this answer
    
My original also has a resource fork of 1650 bytes. What I'm not sure about now is why this affects the size reported by Finder, when the other file metadata reported by ls -l@ doesn't appear to. –  Rich Aug 22 '11 at 14:12
1  
If I remember correctly, the Finder will report a file's size as the combined size of the data and resource forks, but not include the sizes of extended attributes or even other named forks. –  joelseph Aug 22 '11 at 18:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.