-
Notifications
You must be signed in to change notification settings - Fork 12
Description
In the compress command, it looks like the chunks are all written to a temporary file, then the bita header is written to the output file, and finally the chunks are copied to the output file.
This introduces significant points for failure (esp on Windows) and we should avoid temp files whenever possible. Ideally, we will open the output file once, and then not close it until we are done. So we open the file, write the header first, and then give the same output file handle to the chunker.
If you are in overwrite/force mode, this does introduce a slightly increased possibility that we would have paved over a perfectly good file and left junk in it's wake, but I think that is going to be a less common scenario than the compression has failed because Windows Defender or some other junk has decided to lock the output file between writing the header and copying the chunks etc.