4 ms·
> Because tar does not support encryption/compression on the inside of archives. Yes it does? Just encrypt/compress all the files before tarring. > Not index
by anon_d 16y ago
> Because tar does not support encryption/compression on the inside of archives.
Yes it does? Just encrypt/compress all the files before tarring.
> Not indexed
The reason tar doesn't have an index is so that tarballs can be concatenated. Also IIRC, you only have to jump through the headers for all files. Still O(n) where n is the number of files, but you don't have to scan through all of the data.
- gwern 16y ago> The reason tar doesn't have an index is so that tarballs can be concatenated. I'm curious, what's the use-case for this? Offhand, the only use for that ability I can think of is if I forgot a file in a tarball and have already deleted the originals; I can tar the missing file and cat the two tarballs.
- dagw 16y agoDon't think files, think tapes. Tar stands for Tape ARchive and was originally primarily used for backing up to tapes. When working with tapes where deleteing and re-writing archives is basically impossible, concating an archive to the end of an already backed up archive to create a new, updated archive is very useful.
- gwern 16y agoAh, I see. Yes, that does sound very useful.
- cybernytrix 16y agoCompress before tarring is a really dumb idea and you will get terrible compression ratios - you cannot exploit data patterns across files. It could work if you ask gzip to write some sort of a global table...
- Nelson69 16y agoYou also make a bad block affect potentially every file following it. When if you compress pre-tar you could find the next file boundary and recover the rest.