Proposal for std.path replacement

Andrej Mitrovic andrej.mitrovich at gmail.com
Sat Mar 5 17:43:50 PST 2011


I dunno, maybe I'd prefer an enum.

enum path : string { current = ".", up = ".." };

main() { string newPath = join("C:", "Windows", "Subdir", path.up,
path.up, "Program Files");
newPath == r"C:\Windows\Subdir\..\..\Program Files";

This is just nitpicking however. And 'current' is only used on Linux afaik? :)

On 3/6/11, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
> On Saturday 05 March 2011 17:22:01 Andrej Mitrovic wrote:
>> Without even looking at any posts in this discussion, what is a
>> directory *symbol* anyway?
>
> currDirSym would be ".", and parentDirSym would "..". It's what you use when
> navigating directories backwards. It's quite clear if you look at the docs.
>
> - Jonathan M Davis
>


More information about the Digitalmars-d mailing list