Menu

How I made file moves between drives undoable and verified in a Rust desktop app
πŸ“°

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

DEV Community: githubΒ·Tural MustafayevΒ·about 6 hours ago
#bWrxlsEC
#devtogithub#technology#devto#dev#library
Reading 0:00
15s threshold

Tural Mustafayev

  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