Skip to content

path.rs: "consts::path_sep" wrong on Windows? #2752

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

Closed
kud1ing opened this issue Jun 29, 2012 · 3 comments
Closed

path.rs: "consts::path_sep" wrong on Windows? #2752

kud1ing opened this issue Jun 29, 2012 · 3 comments
Labels
O-windows Operating system: Windows

Comments

@kud1ing
Copy link

kud1ing commented Jun 29, 2012

I read this

#[cfg(windows)]
mod consts {
    const path_sep: char = '/';  // "The primary path separator character for the platform"
    const alt_path_sep: char = '\\';
}

and

#[doc = "Get the default path separator for the host platform"]
fn path_sep() -> str { ret str::from_char(consts::path_sep); }

as "'/' is the default and primary path separator on Windows".

Is this a bug?

@brson
Copy link
Contributor

brson commented Jun 29, 2012

It's definitely intentional, I think mostly to make it easier on us, since / works in both places. Clearly though it is wrong is some sense. I'm ok with changing it.

@kud1ing
Copy link
Author

kud1ing commented Jun 29, 2012

Maybe some additional comments will suffice.

@graydon
Copy link
Contributor

graydon commented Aug 29, 2012

Fixed in the new path module (paths get joined with backslash on windows in all cases; though we'll split with forward-slash).

@graydon graydon closed this as completed Aug 29, 2012
RalfJung pushed a commit to RalfJung/rust that referenced this issue Jan 9, 2023
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
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

3 participants