4 ms·
In my app (a search tool for Polish corpora [1]), I'm using ZIP with zero compression (stored files) as a container file format. The upside is that I can easily
by nathell 9y ago
In my app (a search tool for Polish corpora [1]), I'm using ZIP with zero compression (stored files) as a container file format. The upside is that I can easily read the archive contents, and then mmap parts of the file as needed [2].
[1]: https://github.com/nathell/smyrna https://github.com/nathell/smyrna
[2]: https://github.com/nathell/smyrna/blob/master/src/clj/smyrna/corpus.clj#L86 https://github.com/nathell/smyrna/blob/master/src/clj/smyrna...
- nerdponx 9y agoWhy ZIP versus something like TAR?
- umanwizard 9y agoDoesn't ZIP with no compression amount to the same thing as TAR? What are you claiming the difference is?
- mschaef 9y agoDespite the fact that they can be used for similar purposes, the underlying formats are radically different. TAR is a 'Tape Archive'... the metadata for each file is adjacent to the file contents itself. (Which is what you'd expect for a format designed for a linear access media like tape.) For ZIP, there's a single unified directory structure that can be used as an index into the file.
- C4K3 9y agoThat got me thinking, are there any efforts to replace tar? A single unified directory structure does seem like a desirable feature, I'm sure it'd be possible to find other improvements to make in tar. I wonder if anybody is working on a neotar?
- ghettoimp 9y agoWould that be different than ZIP then?
- pyre 9y agoBut then you can't replace "tar.bz2" or "tar.gz" with "<something else>.gz" since ZIP does both container and compression.
- umanwizard 9y agoSure you can. Nothing prevents you from zipping something with compression turned off and then running bz2 on the result.
- mschaef 9y agoThe difference between a 'neotar' effort and a 'neovim' effort is that for 'neotar', you'd have to be using it also for me to send you a neotar file. It may seem like a small thing, but this is a major impediment to the adoption of new formats. (Corollary is that neotar would have to offer major improvements to get people to buy in.) > A single unified directory structure does seem like a desirable feature, It can make it more difficult to incrementally stream out an archive, so it's not a complete win.
- nerdponx 9y agoIt looks like several have tried, including the Library of Congress: https://en.m.wikipedia.org/wiki/Comparison_of_archive_formats https://en.m.wikipedia.org/wiki/Comparison_of_archive_format...
- mkj 9y agoYou can seek to files within a zip file, tar doesn't have an index.
- pyre 9y agoBeing the (T)ape (AR)chive format, it was designed for tape backup, which doesn't really have random access. IIRC you would basically cat the output of tar to the tape.