How I made file moves between drives undoable and verified in a Rust desktop app

2026-10-28来源 dev.to RustEnglish
  1. the problem: my movie library on several drives, moves that half-finish, no undo
  2. the rule I set: never delete a file unless the user explicitly asks
  3. journal first: write every planned step to SQLite before touching the disk
  4. the copy: pipelined reader/writer, flush, read back past the OS cache, compare SHA-256
  5. the switch: staging folder → one rename → library points at the new place
  6. originals to the recycle bin / freedesktop trash (rename-only, never copied)
  7. undo from history, and what happens after a crash mid-move
  8. try it / contribute: https://github.com/mustafayevt/CineVault

原文:https://www.a8q9.cn/en/article/how-i-made-file-moves-between-drives-undoable-and-verified-in-a-rust-desktop-app-6aca14.html

相关文章