Here is a summary of Bandizip's problems, Bandizip has designed a simple extraction process, directly overwrite the data to the corresponding file, “cancel” means “break”,
Bandizip will leave an incomplete file, this operation is not secure enough, because
the user does not need a corrupted data at any time.
The developer then added a concurrency feature to Bandizip, but unfortunately he
copied the logic from the single-threaded version and magnified the problem due to sloppy thread control, resulting in a disaster -
no one knew what file would be corrupted.
To solve this problem perfectly, the answer is the following:
1.
Writes files by copying and then replacing them, which is almost undetectable under normal circumstances, but maximizes data protection.
2.
Modify the software's “Cancel” operation, which should respect the integrity of the data, as mentioned above, and continue with the required process in multi-threaded operations, skipping the other processes.
3. (Optional) The “Cancel” operation can be accompanied by a purge operation to
clear the unfinished decompressed files, so that the user does not need to delete them manually. Note that
developers should test it rigorously to avoid deleting files by mistake.
4. (Optional) If the developer feels that immediate interruption of decompression is necessary, he can add the option “Interrupt” and
warn the user that incomplete data will be retained.