www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - createPath()

reply "Chris Miller" <chris dprogramming.com> writes:
I wrote this function to create any number of nesting directories all at  
once with one directory path. Someone needed it so I'm releasing it:   
Would be handy to add to std.file
Nov 26 2006
parent "Chris Miller" <chris dprogramming.com> writes:
Updated how it handles network share paths:  =


After testing with network shares I realized that std.path.isabs() shoul=
d  =

probably test for network share paths and consider them absolute.
Consider the following, which I often do:
       mypath =3D std.path.join(getcwd(), mypath);
where mypath is `\\foo\bar`

Fix for isabs:
       if(path.length >=3D 2 && r"\\" =3D=3D path[0 .. 2])
          return true;
    // ..continue with existing code..
Dec 08 2006