Skip to content

std::io::fs::symlink returns IoError: OS Error 0 on windows #14490

Closed
@klutzy

Description

@klutzy
fn main() {
    unsafe { ::std::rt::stack::record_sp_limit(0); } // #13259
    std::io::fs::symlink(&Path::new("testtest.c"), &Path::new("test.c")).unwrap();
}
task '<main>' failed at 'called `Result::unwrap()` on an `Err` value:
unknown error (OS Error 0: <locale-specific error message>)

It should return OS Error 1314 as described in #10264. Same symptom even if I call CreateSymbolicLinkW and GetLastError directly. However if I call them on custom #[start], I get the right error (1314).
Therefore this may be a sub-issue of #13259, but I'm a little unsure because the "workaround" does not work. Needs more investigation.

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