3 ms·
Technically speaking, TAR is indexable -- the index is distributed through the archive, at the head of each file. So long as the TAR is uncompressed, you can sk
by duskwuff 5y ago
Technically speaking, TAR is indexable -- the index is distributed through the archive, at the head of each file. So long as the TAR is uncompressed, you can skip from one header to the next by reading the size of each file. It ends up looking like a bunch of random I/O, but it's manageable. (The headers are even sector-aligned!)
The problem arises when the TAR is compressed with a stream compressor (as most are). Since stream compression formats generally aren't seekable, there's no way to read each header without uncompressing the rest of the file in the process.
> And it also suffer the same problem from zip: the charset is undefined. Newer archive format most enforcing utf-8 charset.
On the flip side, this means that those archive formats can't archive the contents of a filesystem which contains inconsistently encoded (or flat-out nonsense) filenames.
So long as filesystems haven't "solved" the encoding problem, I wouldn't fault an archive format for behaving similarly.
- mmis1000 5y ago> Technically speaking, TAR is indexable -- the index is distributed through the archive, at the head of each file. Actually, zip works in the same way as tar. So the central dict is locate at the end of file because it can only be decided after all works finished. And zip actually struct the first part of file with file info before every block in layout similar to tar, so stream decoding is possible. (Although it IS a violation of specification to decode file based on per file info instead of central record in zip standard) > On the flip side, this means that those archive formats can't archive the contents of a filesystem which contains inconsistently encoded (or flat-out nonsense) filenames. It is a good thing IMO because you can't contribute to the problem more now (at the price not able to backup already screwed up disks. Well..., at least old format(tar) still works on old disk)