On Tue, 01 Mar 2011 07:48:56 -0500, Nick Sabalausky wrote: > "Lars T. Kyllingstad" <[email protected]> wrote in message > news:[email protected]... >> >> I would like to say, however, that I think 'sep' is almost up there >> with rel2abs in terms of bad naming. If you just see 'sep' in a piece >> of code, maybe you understand it is a separator, but I don't think >> everyone will conclude it is a directory separator. Using the fully >> qualified name 'std.path.sep' isn't good either, because now it looks >> like it's a path separator. >> >> > Speaking of sep, I've never been entirely happy with std.path's tendency > to encourage the use of platform-specific directory separators. Windows > generally handles forward-slash just fine, so I've always felt it best > to always just use forward-slash, and then convert to backslash > as-needed in the very rare cases where it actually matters. > > Doing either std.path.join("..", "dir", "subdir", "file") or > ".."~sep~"dir"~sep~"subdir"~sep~"file" is fucking butt-ugly, and it's > useless anyway since "../dir/subdir/file" works just fine on all OSes > including Windows. (Obviously sep should still exist, regardless of what > it's named. But, at least judging by the docs, std.path just seems to > rely on it too much.)
This was discussed on the Phobos mailing list a while ago, and Walter said that using forward-slash often doesn't work on Windows: http://lists.puremagic.com/pipermail/phobos/2010-April/000309.html I don't use Windows much myself, so I don't know. -Lars
