Skip to main content

clear_directory

Function clear_directory 

Source
pub fn clear_directory(dir: &Path) -> Result<(), Box<dyn Error>>
Expand description

Remove and recreate a directory.

Retries on ENOTEMPTY — observed under CI overlay/tmpfs filesystems where the final rmdir races with leftover dentries even after all children are gone. Linux returns 39, macOS/BSD return 66 — match both.