lilyball / rust-lua

Safe Rust bindings to Lua 5.1
MIT License
127 stars 23 forks source link

Aux reserved #22

Closed Toornax closed 9 years ago

lilyball commented 9 years ago

@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.

branarm commented 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

lilyball commented 9 years ago

Oh that's pretty bizarre.

lilyball commented 9 years ago

@branarm I should be allowed to use a name like aux_.rs, right?

Toornax commented 9 years ago

@kballard i try aux_.rs on windows, it's allowed ;)

lilyball commented 9 years ago

78d01513d9feff11de298f4d5dd636386398e0be has been pushed and covers this issue. Thanks for the PR.

lilyball commented 9 years ago

@Toornax Good to know, thanks!

Toornax commented 9 years ago

@kballard don't mention it !