Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Also the only way such a file can be editable which was a major design goal of the zip format and which is not really possible with Tar files.


Not sure what you're saying here. Tar supports appending new files and new versions of files to an existing archive without rewriting the entire archive. I don't believe it supports marking files as deleted (not sure why, tbh) but you can add an empty file with the same name for non-tape storage to prevent extracting the original version. It does this by simply appending the new version of the file to the end of the archive, which is understandable as unlike zip files tar (tape archive) was designed explicitly for tape, where there is no random access. Unless you're referring to editing files in-place inside a tar file, which should actually be easier than doing so with a zip file (as long as the new version isn't longer than the old version, and you're not actually storing it on tape).


So there’s three options: index at the beginning, index at the end and no index.

Index at the beginning means it’s easy to look up, but impossible to add anything.

No index, which is tar, means it’s impossible to tell what’s in it without reading the entire file.

Index at the end, which is zip, means you have to do slightly more work to find the index, but then you can read it without reading the rest of the file, and move it further along the file if you want to extend the file and you can edit it or add to it.

And if you want compression tar is just a compressed blob and the only thing you can do is read it from beginning to end. That’s just not very helpful unless the only things you want to do are packages a bunch of things and unpack all of them. A major use case but one met perfectly fine by hundreds of formats.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: