Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
klutzy opened this issue May 28, 2014 · 5 comments
Closed

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

klutzy opened this issue May 28, 2014 · 5 comments
Labels
O-windows Operating system: Windows

Comments

@klutzy
Copy link
Contributor

klutzy commented May 28, 2014

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.

@klutzy
Copy link
Contributor Author

klutzy commented May 28, 2014

(tested on windows 8.1 korean)

@huonw huonw added A-windows and removed A-iOS labels May 28, 2014
@retep998
Copy link
Member

I just experienced a similar issue where MapViewOfFile was failing with ERROR_NOACCESS until I used a custom #[start].

@Felk
Copy link

Felk commented Jun 10, 2014

I'm having the same error with a BufferedWriter.

fn main() {
    unsafe { ::std::rt::stack::record_sp_limit(0); }
    let file = File::open(&Path::new("test.txt"));
    let mut writer = BufferedWriter::new(file);
    println!("Flush: {}", writer.flush());
}

simply produces

Flush: Err(unknown error (OS Error 0: Der Vorgang wurde erfolgreich beendet.))
(= "the operation completet successfully.")

On Windows 7 (6.1.7601) german
rustc 0.11.0-pre-nightly

@alexcrichton
Copy link
Member

I have a suspicion that d42cc13 may have fixed this. Could others test and see if it is indeed fixed?

@alexcrichton
Copy link
Member

Closing, both of these are working as intended now (fixed by the commit I reference)

bors added a commit to rust-lang-ci/rust that referenced this issue Jun 5, 2023
internal: Switch crate graph to use an Arena instead of a hashmap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows Operating system: Windows
Projects
None yet
Development

No branches or pull requests

5 participants