Windows implementation of `Dir::rename` resolves `from` path without considering `self` at all
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
The actual rename is fine, but there is an is_dir call that's wrong:
This is needed because open_file_native apparently needs to know whether the file it opens inside a Dir is a directory or not. That seems odd? Obviously in reality we might not be able to know this...
Cc @ChrisDenton @Qelxiros
Tracking issue: https://github.com/rust-lang/rust/issues/120426
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 in library/std/src/sys/fs/windows/dir.rs, especially the is_dir call at lines 89-94 and open_file_native at lines 139-148. Trace how Dir::rename resolves its from path relative to self and why open_file_native needs directory information; done means the Windows implementation handles the directory-relative source path correctly, with behavior checked against the tracking issue #120426.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100