| ▲ | cmovq a day ago | |||||||||||||||||||||||||||||||||||||
> Perhaps surprisingly, the ZIP file puts the central directory - which lists the content of the ZIP file - at the end of the file This is very common for archive files. It lets you easily append a file to the end of the archive (overwriting the directory) followed by the updated directory. If it were at the start, you’d have to rewrite the entire contents of the archive to grow the directory. | ||||||||||||||||||||||||||||||||||||||
| ▲ | flomo a day ago | parent | next [-] | |||||||||||||||||||||||||||||||||||||
> This is very common for archive files. Maybe. But Unix types have always been all-in on tar. They love tar. They continue to use some form of tar to this day. This was actually a 'cultural issue' back in the day, because Sun Java JAR files were just ZIPs. For good reason. But that wasn't the blessed holy unix archive format. | ||||||||||||||||||||||||||||||||||||||
| ▲ | yjftsjthsd-h a day ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||
I always assumed you could work around this by pre-allocating a large enough header space to hold a reasonable sized directory tree. You could even then append a supplementary directory if you run out of space and just stick a pointer in the first one. I'm pretty sure that's just reinventing an actual filesystem, but if it works... | ||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||
| ▲ | ahefner a day ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||
Do you really need a central directory? The tar and cpio file formats basically append files serially with a small header preceeding each one, and for most use cases this is sufficient. | ||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||
| ▲ | LoganDark a day ago | parent | prev [-] | |||||||||||||||||||||||||||||||||||||
I'm curious, is there a reason why you can't incrementally prepend to files? I haven't seen a filesystem that allows prepending to a file without rewriting the entire file. Is it just because it's not traditional, or is there any particular technical reason why it would be too expensive, or etc? | ||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||