rnote icon indicating copy to clipboard operation
rnote copied to clipboard

More resilient file saving by a two-stage file save process - Issues 1096, 1128

Open anesthetice opened this issue 7 months ago • 0 comments

Implementation of a two-stage file save process:

  1. Serialized and compressed data saved to a temporary file in the same directory (.tmp)
  2. Checksum calculated from the internal bytes using crc32fast (MIT license)
  3. External checksum calculated from the temporary file
  4. If the checksum match, the previous save file is removed, and the temporary file is renamed
  5. 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:

2024-07-19-110837_hyprshot 2024-07-19-110925_hyprshot

anesthetice avatar Jul 19 '24 09:07 anesthetice