MacOS adds XZ-compression support

I’ve stumbled upon a pleasant new feature for those who like their downloads compact and fast. The built-in Archive Utility on Mac OS X 10.10 “Yosemite” now supports decompressing/extracting from the highly efficient XZ compression format.

Archive Utility is a small program that opens when users compress or decompress files in Mac OS X. Its interface is seen as a small window showing the overall progress of the operation. XZ files can now be opened effortlessly by double-clicking on downloaded XZ files.

XZ is a file format that uses the highly efficient LZMA compression algorithm. On most files, it will produce files that are much smaller than those of the venerable ZIP format.

Archive Utility has added support for the file extensions .xz for XZ files, and .txz and .tar.xz for TAR archives compressed in an XZ file. XZ only supports a single file so another format, like TAR, must be used to create an archive to contain multiple files in one compressed file.

There’s no way to create XZ files from the graphical user interface. Neither is XZ Utils included for use in the command-line. XZ Utils can, however, be installed using homebrew for anyone wanting to distribute software or other files in XZ files. Without installing anything, a TAR archive can be created with XZ compression using the tar program with the undocumented --xz argument.

Update 1

It turns out the XZ support in Mac OS X 10.10 is kind of broken. Single-file XZ file streams like those created by XZ Utils, 7zip, and other popular compression utilities are entirely unsupported.

Only XZ files containing a TAR archive are supported. Mac OS X insists that there must be a TAR archive inside XZ files or it will choke on it. A TAR archive can contain a single file, so that can be used to work around the issue for compressing individual files.