-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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: -r option fails to remove unreadable directory #7033
Comments
hi, i'd like to work on this |
@r3yc0n1c sure, go ahead :) |
I made a first draft in pull request #7299 but it's not as straightforward as it seems. My implementation passed all of our Rust tests, but it caused lots of failures in the GNU test cases. So I think there are lots of holes in our tests. Also our implementation has a different code path for the verbose and not verbose cases. You can get a sense of the differences here:
For comparison, here are the
So I think some things to do here would be
|
Change the implementation of `rm -r` so that it is explicitly recursive so that (1) there is one code path regardless of whether `--verbose` is given and (2) it is easier to be compatible with GNU `rm`. This change eliminates a dependency on the `walkdir` crate. Fixes uutils#7033, fixes uutils#7305, fixes uutils#7307.
Change the implementation of `rm -r` so that it is explicitly recursive so that (1) there is one code path regardless of whether `--verbose` is given and (2) it is easier to be compatible with GNU `rm`. This change eliminates a dependency on the `walkdir` crate. Fixes uutils#7033, fixes uutils#7305, fixes uutils#7307.
Change the implementation of `rm -r` so that it is explicitly recursive so that (1) there is one code path regardless of whether `--verbose` is given and (2) it is easier to be compatible with GNU `rm`. This change eliminates a dependency on the `walkdir` crate. Fixes uutils#7033, fixes uutils#7305, fixes uutils#7307.
Change the implementation of `rm -r` so that it is explicitly recursive so that (1) there is one code path regardless of whether `--verbose` is given and (2) it is easier to be compatible with GNU `rm`. This change eliminates a dependency on the `walkdir` crate. Fixes uutils#7033, fixes uutils#7305, fixes uutils#7307.
Environment: Ubuntu 20.04, main branch (git commit 00d1866), GNU coreutils v8.30
Steps to reproduce:
What happens now: uutils
rm
terminates with an error message, removing neithera
nora/unreadable
:What I expected to happen: GNU
rm
terminates successfully and removes both directories.Notes: this is causing a failure in GNU test file
tests/rm/empty-inacc.sh
.The text was updated successfully, but these errors were encountered: