RJVB / afsctool

This is a version of "brkirch"'s afsctool utility that allows end-users to leverage HFS+ compression.
https://brkirch.wordpress.com/afsctool
GNU General Public License v3.0
187 stars 18 forks source link

See compression type per-file when listing multiple files? #28

Open gingerbeardman opened 5 years ago

gingerbeardman commented 5 years ago

Bonjour René - ça va?

I can do -v to see compression type used on a file

$ afsctool -v "/Applications/Affinity Designer.app/Contents/PkgInfo"
/Applications/Affinity Designer.app/Contents/PkgInfo:
File is HFS+/APFS compressed.
Compression type: ZLIB in decmpfs xattr (3)
File content type: public.data
File size (uncompressed; reported size by Mac OS 10.6+ Finder): 8 bytes / 0 KB (kilobytes, base-10)
File size (compressed): 0 bytes
Compression savings: 100.0%
Number of extended attributes: 0
Total size of extended attribute data: 0 bytes
Uncompressed file size reported in compressed header: 8 bytes

And I can do -lfvvv to see what files are compressed in a folder.

$ afsctool -vlfvvv "/Applications/Affinity Designer.app"
...
/Applications/Affinity Designer.app/Contents/PkgInfo:
File size (uncompressed data fork; reported size by Mac OS 10.6+ Finder): 8 bytes / 0 KB (kilobytes, base-10)
File size (compressed data fork): 25 bytes
Compression savings: 100.0%
Number of extended attributes: 0
Total size of extended attribute data: 0 bytes
Approximate overhead of extended attributes: 268 bytes

Is there a way I can see compression type per-file when listing multiple files?

Thanks!

RJVB commented 5 years ago

And I can do -lfvvv to see what files are compressed.

Did you try specifying multiple files after those options? Both

afsctool -lfvvv /path/to/somedir/*

and

afsctool -lfvvv /path/to/somedir

Output show the compression details of all files in the directory (with some differences in formatting).

I have been meaning to revisit the verbose output for a while now. I noticed that after a recent change it shows the compression gain results only for the files that were compressed during a run. That is kind of acceptable if you give a list of files to compress, if you target a folder the reported gain is lower if you re-run the command a 2nd time immediately after the 1st time. I also noticed that the reported gain is 0 if you disable the verification step (-n option).

Life keeps getting in the way though.

gingerbeardman commented 5 years ago

Yes, it's the differences in formatting that I have noticed. Multiple files omits compression type.

gingerbeardman commented 5 years ago

Some examples:

afsctool -v /Applications/Affinity\ Designer.app/Contents/MacOS/Affinity\ Designer | grep "Compression type"

Compression type: ZLIB in resource fork (4)

afsctool -lfvvv /Applications/Affinity\ Designer.app/ | grep "Compression type"

(nothing)

afsctool -lfvvv /Applications/Affinity\ Designer.app/* | grep "Compression type"

(nothing)