In my app I'm using Apple's hdiutil command line utility to create compressed disk images (DMGs) of folders/volumes. Is there any way to calculate the compressed size of a given source path? I've already checked in the man pages, nothing there.
Can you just compare the size of the disk image vs the size reported by either df (reporing the size of the volume) or du (reporting the size of files in a directory)?