Function remove_dir_all::ensure_empty_dir[][src]

pub fn ensure_empty_dir<P: AsRef<Path>>(path: P) -> Result<()>

Makes path an empty directory: if it does not exist, it is created it as an empty directory (as if with std::fs::create_dir); if it does exist, its contents are deleted (as if with remove_dir_contents).

It is an error if path exists but is not a directory (or a symlink to one).