`Dir::open_file_with` (and likely more `Dir` methods) on Windows does not support `/`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Usually, our fs methods on Windows support the / file separator, not just \. However, for the Dir methods, that does not seem to be true -- the following fails
dir.open_file_with("subdir/bar.txt", &OpenOptions::new().create(true).write(true))
saying
The filename, directory name, or volume label syntax is incorrect. (os error 123)
I suspect this is caused by internally using NtCreateFile rather than CreateFileW.
Tracking issue: https://github.com/rust-lang/rust/issues/120426
Cc @ChrisDenton @Qelxiros
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 with the Windows implementation of Dir methods involved in Dir::open_file_with and compare the failing "subdir/bar.txt" reproducer with the behavior of the fs methods that accept '/'. Inspect the suspected NtCreateFile path and the tracking issue #120426; done means the Dir methods accept '/' on Windows without the reported OS error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100