std.path.buildPath should convert its input to the correct path representation (e.g., replace slashes with backslashes). Most of the time, Windows can use the forward slash, but Phobos should always return paths with backslashes because: - a couple of weird things can happen with some API functions [0]. - backslashes are required for extended-length paths (prepended with "\\?\") [1]. - consistency; if I'm going to print a path to the user, it needs to be what they'll expect, and I shouldn't have to modify what the standard library returns. Note that Windows does call "\foo" an absolute path (it implicitly prepends the current drive). > writeln(buildPath("c:\\asdf", "/bcd")); // "c:/bcd"; want "c:\bcd" > writeln(buildPath("c:\\asdf/", "bcd")); // "c:\asdf/bcd"; want "c:\asdf\bcd" > writeln(buildPath("c:/asdf", "d:/bcd")); // "d:/bcd"; want "d:\bcd" [0] LoadLibrary: https://msdn.microsoft.com/en-us/library/windows/desktop/ms684175(v=vs.85).aspx?f=255&MSPPError=-2147217396 "When specifying a path, be sure to use backslashes (\), not forward slashes (/)." [1] https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#paths
Implicit conversions are evil and inefficient. If your program must not have forward slashes in its paths, then they should not have reached buildPath anyway. If you do want to normalize slashes, use buildNormalizedPath etc.
I didn't notice the normalizedPath variations. Thanks.