rnote
rnote copied to clipboard
More resilient file saving by a two-stage file save process - Issues 1096, 1128
Implementation of a two-stage file save process:
- Serialized and compressed data saved to a temporary file in the same directory (.tmp)
- Checksum calculated from the internal bytes using crc32fast (MIT license)
- External checksum calculated from the temporary file
- If the checksum match, the previous save file is removed, and the temporary file is renamed
- File watcher updated with the new save file
According to my simple benchmarks (EndeavourOS, Ryzen 5 5500U) , this does impact the saving time, but not significantly so: