4 ms·
What's the point of doing this instead of just a regular directory with a metadatafile and zipping the whole thing ? That's how most modern document softwares d
by sametmax 8y ago
What's the point of doing this instead of just a regular directory with a metadatafile and zipping the whole thing ? That's how most modern document softwares do it, including MS office and libre office.
- eesmith 8y agoYour "just" description doesn't support atomic in-place updates. I don't know what MS Office/LibreOffice do. Do they create a new file then rename? See https://stackoverflow.com/questions/20634684/what-is-sublime-text-doing-when-i-save-a-file https://stackoverflow.com/questions/20634684/what-is-sublime... for disadvantages to that. The zip file format allows in-place appends and deletes. This is non-atomic as it depends on a central directory located at the end of the file. An incomplete write of the directory can be recovered by looking through the file, but as the Wikipedia page notes: > tools that attempt to recover data from damaged ZIP archives will most likely scan the archive for local file header signatures; this is made more difficult by the fact that the compressed size of a file chunk may be stored after the file chunk, making sequential processing difficult. The file format described at this link assumes that modifying the 4 byte offset to the correct ToC is always atomic. Even if not, it's a much smaller window.
- marci 8y ago> The idea was to create a format not unlike an entire web site packed into a single file, containing text, images, code, and what connected them into a whole. If it were a web site, it would contain every singe page of that web site and would be able to edit a single page/image/audio/js/css without the need to rewrite the entire file each time. >Instead of changing data, we always write a new copy. And it's a Copy-on-Write file format.