Skip to content

Dir::open_file_with (and likely more Dir methods) on Windows does not support / #163032

Description

@RalfJung

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: #120426
Cc @ChrisDenton @Qelxiros

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-windowsOperating system: WindowsT-libsRelevant to the library team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions