3 ms·
Also note in this proposal: > The path separator is a forward slash, even on Windows systems. Which is much more ergonomic for developers than rusts treatment
by leetrout 6y ago
Also note in this proposal:
> The path separator is a forward slash, even on Windows systems.
Which is much more ergonomic for developers than rusts treatment of os specific paths.
- Arnavion 6y agoForward slashes work on Windows systems for most [1] paths. You can write `include_bytes!("foo/bar.txt")` in Rust and be very confident it'll compile correctly for most of your users. [1]: "Most" because they don't work for namespaced paths, by design. But note that the number of times you'll encounter those is limited, the Rust standard library doesn't handle them correctly in general, and a lot of other non-Rust software breaks when given them.
- leetrout 6y agoOh, TIL! Well that is good to know- so it is only that windows backslashes fail on linux.
- josefx 6y agoWindows path handling is a horrid mess. It basically takes your input and tries to turn it into a valid NT file path, that also includes handling special device names like COM1. At some point this was limited to 256 chars, so you had to input a valid NT path yourself if you wanted it longer, however I think Microsoft removed that limit a few years ago.