Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rm: remove remove_dir_all dependency #4335

Closed
tertsdiepraam opened this issue Feb 10, 2023 · 0 comments · Fixed by #4340
Closed

rm: remove remove_dir_all dependency #4335

tertsdiepraam opened this issue Feb 10, 2023 · 0 comments · Fixed by #4340

Comments

@tertsdiepraam
Copy link
Member

rm contains this bit of code, written back in July 2017:

use remove_dir_all::remove_dir_all;

// -- snip --

// we need the extra crate because apparently fs::remove_dir_all() does not function
// correctly on Windows
if let Err(e) = remove_dir_all(path) {
    had_err = true;
    if e.kind() == std::io::ErrorKind::PermissionDenied {
        // GNU compatibility (rm/fail-eacces.sh)
        // here, GNU doesn't use some kind of remove_dir_all
        // It will show directory+file
        show_error!("cannot remove {}: {}", path.quote(), "Permission denied");
    } else {
        show_error!("cannot remove {}: {}", path.quote(), e);
    }
}

It seems though that std::fs::remove_dir_all has had some improvements in the meantime (see rust-lang/cargo#11333), so I think it's safe to remove this dependency.

howjmay added a commit to howjmay/coreutils that referenced this issue Feb 10, 2023
howjmay added a commit to howjmay/coreutils that referenced this issue Feb 10, 2023
howjmay added a commit to howjmay/coreutils that referenced this issue Feb 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant