Every file in TAR ends with 1KiB of zeros as “end of file marker”
I don't understand how this format was ever thought to be a good idea
* filename size is exactly 100 bytes
* file size is octal at 8^12 (correction 8^11, 1 byte is /0 so 8 GiB). Why octal and not binary?
* there is extra "end of file" markers of 1024KiB of zeros
* contains NUMERIC owner/group IDs... on a serialized data format meant to be sent between computers (who's IDs other than root might not agree right?)
Why the extra EoF? Is this out of concern for data corruption? If so, why not a simple CRC checker for both detection and recovery?
The whole thing seems poorly designed yet is ubiquitous in Linux. I've used it for more than a decade without ever asking about it's protocol.
Some alternatives off the top of my head:
* remove EoF waste
* 2byte filename lengths, allowing file NAMES up to 64KiB and removing wasted bytes of the 100 bytes which are unused.
* add CRC checksum
* NAMED owner/group, permitting some kind of cross-platform usage. Or just remove this feature entirely (preferable IMO)
* Don't use octal for file size and get nearly infinite file sizes.
17 comments
[ 4.5 ms ] story [ 140 ms ] threadTAR was written for very simple/tiny machines by today's standards, and was designed to read/write full valid blocks on physical tapes with constraints on spool-up and spool-down times/distances.
The description here seems reasonable: https://en.wikipedia.org/wiki/Tar_(computing)
It's really strange to complain that a legacy format is full of bad features for modern tastes and hardware - how do you think it was worked out what bad and good features of formats and hardware might be?
The history in the Wikipedia page that I linked is instructive.
The Wikipedia item explains this.
If space was so important then why waste 1KiB/file? Why waste namelen-100 bytes per file? Why put space into owner/group id?
ARC and ZIP files are written as a fresh take on the idea of archive files, with much more capable hardware, after TAR had been around a couple decades. They have many features designed to use those new hardware capabilities, and were (and still are) very popular because of those.
They have bits that probably seem dated now, too. Breaking archives into floppy size chunks? but without any sort of forward error correction? No format support for unicode? (who cares it wasn't invented when the ZIP file spec was created?)
No. Don't even think about it. tar is. It always will be that way so leave it.
edit: looked into it a bit and it was not much better in fact.