Safe file deletion in a Tauri app: lessons from sending files to the Windows Recycle Bin via Rust
The author is building a Windows disk cleaner in Rust and Tauri 2 and argues that the delete path needs more care than file scanning. The backend treats the webview UI as untrusted and only allows trashing paths that a previous scan actually returned. Protected system locations are excluded, and path comparisons are normalised and matched on folder boundaries to avoid false matches. Before each deletion the code re-resolves paths to catch junctions or links introduced after the scan. The article also notes that not all removals go to the Recycle Bin.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in