`coreutils rm -f` fails with read-only files on Windows
Open
Nobody has claimed this yet.
U - rm
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
On Windows, the call to fs::remove_file fails if the file is read-only.
I think, when using the -f switch, the following snippet (adapted from the doc of the fs library) should be used
let mut perms = fs::metadata(path)?.permissions();
perms.set_readonly(false);
fs::set_permissions(path, perms)?;
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the rm implementation and trace the -f path that calls fs::remove_file on Windows. Check the Rust fs metadata and permission operations shown in the issue, then verify that forced removal succeeds for read-only files without changing normal removal behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100