macOS equivalent to the Windows "Compress file/folder content on disk to save space" option
Windows has a useful feature where files can be transparently compressed/decompressed on the fly. This is activated by right-clicking on a File, directory or Disk, selecting Properties and then clicking on the Advanced... button to check the box "Compress contents to save disk space".
When enabled, files are transparently compressed when written to disk and decompressed when read from disk. This is managed by the file system and OS as needed.
I'd like a Mac OS equivalent of this. There's nothing obvious in the Finder and a preliminary search turns up nothing conclusive.
Is there a macOS option equivalent to this? Either natively or through 3rd party software?
Solution 1:
This is actually a feature of the NTFS file system (I believe...) and hails from the days when disks were more expensive, much smaller and measured in megabytes. Microsoft has kept this functionality in all versions of windows since the early days of NT.
While you can manually compress files to save space I realize that is not what you are looking for. However I am not aware of a utility or feature of macOS that allows automatic file system level compression of disk contents.
Note that in an article on ArsTechnica it is noted that it sounds like file system compression may be coming to APFS in the (near or otherwise) future.
There may be something in APFS that allows this but so far neither Apple nor any third parties (that I am aware of) has implemented this functionality.
Solution 2:
Note: this is not exactly the end-to-end solution on MacOS but it leverages the transparent compression in NTFS.
I was looking for the same functionality as I work with large uncompressed rasters (DEM - digital elevation models) and I had to make sure I will not run out of the disk space while processing these files.
I've done this on USB drive. I attached the drive to Parallels Desktop (but I believe it can Virtual Box or any physical windows machine), formatted it using NTFS, created a folder and marked it as compressed - all in Windows.
Then I mounted the drive to my MacBook. (I use NTFS for Mac from Paragon Software but other apps like this one should handle it). Any file that i wrote to the folder created on windows was compressed automatically.