Rewrite remove_dir_all to be correct

The fact that this had to be rewritten does not bode well
This commit is contained in:
Peter Atashian 2018-02-01 20:35:50 -05:00
parent b1b9edf5ae
commit dcf53c1590
No known key found for this signature in database
GPG key ID: DE04D9E27559BC8A

View file

@ -611,9 +611,11 @@ fn remove_dir_all_recursive(path: &Path) -> io::Result<()> {
let child = child?;
let child_type = child.file_type()?;
if child_type.is_dir() {
remove_dir_all_recursive(&child.path())?;
} else if child_type.is_symlink_dir() {
rmdir(&child.path())?;
if child_type.is_reparse_point() {
rmdir(&child.path())?;
} else {
remove_dir_all_recursive(&child.path())?;
}
} else {
unlink(&child.path())?;
}