3 ms·
Your "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:/
by eesmith 8y ago
Your "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.