8 ms·
You don't loathe tar files due to a deficiency in the tar format. You loathe tar files because your operating system vendor doesn't build in support for one of
by mort96 4y ago
You don't loathe tar files due to a deficiency in the tar format. You loathe tar files because your operating system vendor doesn't build in support for one of the most widely used archive formats in the world. Complain to Microsoft, not to people who use tar.
Tar might've been designed for use with tape, but no part of its design makes the HDD/SSD use-case worse just to work better with tape.
- guipsp 4y agoWell, the lack of index for one
- spicybright 4y agoIt seems fairly trivial to scan the whole file and build an in memory index to speed things up, and I'm sure most viewers do. I can't say I've ever had significant speed issues with most archives to see this as a problem.
- lazide 4y agoGood luck doing that with a multi-terabyte compressed tar file!
- nrclark 4y agoI see tar files used with compression pretty often, usually gzip or xz. That can mess up the ability to seek around in the tar archive and build a good index. I use tar.gz as my go-to archive format, don't get me wrong. It's easy, well-supported, handles POSIX concepts well, and is pretty universal. But seekability isn't it's strong-suit.
- jcrawfordor 4y agoIt's actually pretty terrible in practice. Keep in mind that most common tar files have also been run through a stream compression algorithm, which means scanning the archive for file headers requires decompressing the entire thing. Some software does index tar files automatically (and of course the typical CLI tools will if you want) but for a large archive, say 20gb, I have had to stare at a progress bar for 30s+ while the tool indexed the archive. Extracting a single file required another 30s+ wait while it scanned the archive again to get back to that file, since with gzip compression it's not trivial to store enough state to be able to decompress at a point without having to decompress everything up to there.
- forrestthewoods 4y agoWhat makes tar files better than zip files? Why should anyone prefer .tar.xz to an even more commonly used format that has even broader support?
- mort96 4y agoI wasn't saying tar is better than zip (though if you want to read about issues with the zip file format, have a look at this post: https://games.greggman.com/game/zip-rant/ https://games.greggman.com/game/zip-rant/ -- HN discussion: https://news.ycombinator.com/item?id=27925393 https://news.ycombinator.com/item?id=27925393). I'm just saying there's nothing about the tar file format itself that makes you loathe it, you just loathe that Windows doesn't support it. That's not a problem with tar. I don't even know if it's true that tar is less common than zip. I know zip is incredibly common, but truly, so is tar. In the UNIX world, _everything_ happens through tar. And as someone who almost exclusively operates in the UNIX world, I interact with zip files very rarely, while I work with tarballs all the time. Just don't blame the format for a deficiency in your operating system, that's all I'm saying.
- forrestthewoods 4y agoTo be fair, I almost never come across tar files. Most crossplatform software provides .tar.gz for Linux/macOS and .zip for Windows. Should windows have native support for tar.gz files? Maybe! Maybe not. I dunno. So when I come across something using that format for windows what it really comes across is half-ass Windows support. Which isn’t the end of the world. But it’s rarely a good sign.
- mort96 4y agoAh, yeah, that's completely fair. If someone is making an archive _for Windows users_, that archive should absolutely be a zip. A tarball definitely sends the signal that Windows users aren't the primary audience. Sometimes that's okay, sometimes it's a sign of a really shoddy port.
- 4y ago
- thayne 4y agoI exclusively use linux, and I wish there was something better than tar that was more widely used. In particular, that didn't have the problem of several subtly incompatible sets of extensions, and that had better support of using an index, especially in tandem with compression. But that "something better" isn't zip. It's probably something that doesn't currently exist.
- usefulcat 4y agoI believe pixz adds a file index when compressing tar files. It’s definitely much, much faster at extracting a single file from a large archive compared to a tar file compressed with gzip or zstd.
- jakogut 4y agoWhat about 7z? https://en.m.wikipedia.org/wiki/7z https://en.m.wikipedia.org/wiki/7z
- thayne 4y ago7z doesn't support unix file permissions, which means it isn't suitable as a tar replacement.
- ciupicri 4y agoFor what it's worth there is the SQLite Archive, but it's definitely not popular and there is no support for metadata like ownership, permissions or extended attributes (ACLs, SELinux). Also compression is missing on my Fedora system. https://www.sqlite.org/sqlar.html https://www.sqlite.org/sqlar.html / https://news.ycombinator.com/item?id=28668615 https://news.ycombinator.com/item?id=28668615
- thayne 4y ago> there is no support for metadata like ownership, permissions or extended attributes That makes it unsuitable as a tar replacement for many use cases.