macoszipsolarismacos-sierrasolaris-10

.Zip file size decreasing / anomaly


I have created a .Zip file (files.zip) on my Mac - macOS Sierra. I then created an ISO of the folder containing the .Zip file using:

hdiutil makehybrid -o ~/Documents/files.iso ~/Documents/files -iso

The file size is 4.28 GB. I then mount files.iso as a CD-Rom onto a Solaris 10 (64-bit) VM and copy the files locally. The .zip file is exactly 4.0 GB.

What is happening to the lost files?


Solution

  • Nothing lost, just a different divisor for k,m,g and so on ...

    For example the Solaris 11.3 iso is 771.753.984 Bytes large. Mac OS reports it as 771.8 MByte. This means Mac OS is calculated with 1000 Bytes a Kilobyte (and similar for Mega, Giga). The tools you are looking to the filesize of Solaris, are using 1024 Bytes a Kilobyte (the way this stuff was calculated for a long long long time). Or as it's called today. A kibibyte. You are seeing Kibibytes in Solaris.

    So, essentially your file is 4.28 Gigabytes or 4 Gibibytes large. When you look into the man page of ls for the option -h for 11.3 for example you will see this 1024 documented.

    If you want to see the same numbers as in Sierra, use ls -l --si (a file displayed as 30M with ls -lh as is shown as 31M with ls -ls --si)