How I made file moves between drives undoable and verified in a Rust desktop app
2026-10-28来源 dev.to RustEnglish
- the problem: my movie library on several drives, moves that half-finish, no undo
- the rule I set: never delete a file unless the user explicitly asks
- journal first: write every planned step to SQLite before touching the disk
- the copy: pipelined reader/writer, flush, read back past the OS cache, compare SHA-256
- the switch: staging folder → one rename → library points at the new place
- originals to the recycle bin / freedesktop trash (rename-only, never copied)
- undo from history, and what happens after a crash mid-move
- 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