Skip to content
/ rm_rf Public

Force-remove a file/directory and all descendants in Rust

Notifications You must be signed in to change notification settings

vn971/rm_rf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rm -rf CI crates.io

Force-remove a file/directory and all descendants.

In contrast to std::fs::remove_dir_all, it will remove empty directories that lack read access on Linux, and will remove "read-only" files and directories on Windows.

Usage

rm_rf::remove("target")?; // remove, fail if target doesn't exists (this is `rm -rf` behavior)
rm_rf::ensure_removed("target")?; // remove, but ignore if target doesn't exist

Note: to avoid stack overflow for deeply nested directories, this library uses stacker.

Other

Licensed as (at your choice): MIT, Apache2 and CC0 ("public domain").

About

Force-remove a file/directory and all descendants in Rust

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages