3 ms·
Is it likely that a user has gzip on a system but not tar itself? From the article: What about tooling? OSX: tar -xf some.tar.xz (WORKS!) Linux: tar -xf some.t
by rileymat1 11y ago
Is it likely that a user has gzip on a system but not tar itself?
From the article:
What about tooling?
OSX: tar -xf some.tar.xz (WORKS!)
Linux: tar -xf some.tar.xz (WORKS!)
Windows: ? (No idea, I haven't touched the platform in a while... should WORK!)
- zorked 11y agoTar does not implement decompression. If you don't have xz installed it won't work.
- masklinn 11y agoThat doesn't seem correct, on osx 10.11 `tar xf` can extract `.tar.xz` yet doesn't fork an xz. AFAIK 10.11 doesn't even come with xz.
- jessaustin 11y agotar can link the xz lib without forking.
- masklinn 11y agoSo tar does "implement decompression" (and compression, by delegating the work to libarchive) and it can work even "if you don't have xz installed".
- jessaustin 11y agoIt would require liblzma, but you are correct that the library is a separate thing from the executable xz.
- masklinn 11y ago> It would require liblzma Yep, in the same way it requires libz and libbz2.
- killercup 11y agoIIRC bsdtar (e.g. on OS X) includes xz.
- the_mitsuhiko 11y agoPretty sure tar -xf does not actually work on osx unless you download a recent tar.
- M4v3R 11y agoI have tar that came with the system (latest OSX) and tar -xf works just fine. And it did work fine for as long as I can remember.
- masklinn 11y agoIt does, and should have since at least 10.6 (I can find references to 10.6's tar being built on libarchive and that's one of libarchive's headline features; 10.5 predates libarchive so it may not have supported that)
- darkr 11y agoOn the vast majority of Linux distributions, you can pretty much guarantee that both tar and zlib will be installed. Both tend to be part of an essential core of packages required to install a system.