Delete one already-resolved working-copy path, as `atomic remove` does when a path has to leave the working copy. Directories leave recursively: a recorded directory's untrack reports its contents before the directory itself, so a non-recursive removal would fail on the still-occupied parents and leave the tree half-untracked. A path that is already absent needs no deletion and is a success — it
(path: &std::path::Path)
| 40 | /// swallowed: reporting a removal whose bytes are still on disk is the failure |
| 41 | /// this exists to prevent. |
| 42 | fn remove_from_working_copy(path: &std::path::Path) -> std::io::Result<()> { |
| 43 | if path.is_dir() { |
| 44 | std::fs::remove_dir_all(path) |
| 45 | } else if path.exists() { |
| 46 | std::fs::remove_file(path) |
| 47 | } else { |
| 48 | Ok(()) |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | // --------------------------------------------------------------------------- |
| 53 | // DaemonService |
no test coverage detected