Closed Toornax closed 9 years ago
@kballard I don't think Windows will normally let you create files or folders with the name "aux" (or "aux" followed by a file extension), this also applies to a handful of other words, here are some links that popped up on Google: http://support.microsoft.com/kb/71843 http://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words https://ionicflux.wordpress.com/2006/09/02/windows-reserved-words/
(Testing on Windows 7, I get the error thread '<main>' panicked at 'Error: couldn't create file (file not found (OS Error 2: The system cannot find the file specified.); path=aux.rs; mode=truncate; access=write)' test.rs:6
when running the following code:
#![allow(unstable)]
use std::io::File;
fn main() {
match File::create(&Path::new("aux.rs")) {
Ok(f) => f,
Err(e) => panic!("Error: {}", e),
};
}
(Running rustc 1.0.0-alpha)
I also get "The specified device name is invalid" when trying to name a file or folder "aux.rs" using Window's default file explorer, "The directory name is invalid" when running mkdir aux.rs
and "The system cannot find the file specified" when running echo test > aux.rs
)
Edit: @THUNDERGROOVE linked a good link about this in #21: http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx
Oh that's pretty bizarre.
@branarm I should be allowed to use a name like aux_.rs
, right?
@kballard i try aux_.rs
on windows, it's allowed ;)
78d01513d9feff11de298f4d5dd636386398e0be has been pushed and covers this issue. Thanks for the PR.
@Toornax Good to know, thanks!
@kballard don't mention it !
@Toornax Thanks for the PR. What do you mean by "aux is reserved on windows"? "reserved" implies that Rust has reserved the token as a keyword, but I'm not aware of Rust having platform-specific keywords.