std.path review: update

Andrej Mitrovic andrej.mitrovich at gmail.com
Sun Jul 17 15:24:30 PDT 2011


On 7/17/11, Lars T. Kyllingstad <public at kyllingen.nospamnet> wrote:
> - Should I add toNativePath(), which replaces '/' with '\' on Windows and
> vice versa on POSIX?

Actually I withdraw that feature request. Some tools will work with
only forward slashes, others only backward slashes, but this is
regardless of what platform they're on.

E.g. some tools don't work with forward slashes, while GIT doesn't
work with backward slashes when running on Windows.

I think .replace(r"\", "/") and .replace("/", r"\") are good enough,
but maybe an alias to each version wouldn't be bad. E.g.
"toForwardSlash" and "toBackslash". It's not hard to define this in
our own code, so it's not really a feature request.


More information about the Digitalmars-d mailing list