Skip to content

Failure to open existing files in Open mode on windows #13861

@Seldaek

Description

@Seldaek

Using this code on windows the first time it works and creates the test file, the second time I run it it fails to open the file, opening with Append or Truncate mode works though.

fn main() {
    let path = Path::new("test");
    println!("{:?}", std::io::File::open_mode(&path, std::io::Open, std::io::ReadWrite));
}

Err(std::io::IoError{kind: OtherIoError, desc: "unknown error", detail: Some(~"OS Error 80: The file exists.\r\n")})

Not sure if it fails on linux, but I'll assume not since nobody reported this yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-windowsOperating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions