Thread overview
[Issue 5759] New: std.path.join incorrectly joins directories
Mar 20, 2011
Andrej Mitrovic
Mar 20, 2011
Andrej Mitrovic
Mar 21, 2011
Andrej Mitrovic
March 20, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5759

           Summary: std.path.join incorrectly joins directories
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: andrej.mitrovich@gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2011-03-20 10:15:24 PDT ---
import std.file;
import std.path;

string subdir;

static this()
{
    subdir = join(curdir, r"\subdir\");
}

void main()
{
    assert(subdir == r"\subdir\");  // this is incorrect
    if (!exists(subdir))
    {
        mkdirRecurse(subdir);       // creates "C:\subdir\"
    }

    subdir = r".\subdir\";          // correct version
    if (!exists(subdir))
    {
        mkdirRecurse(subdir);       // creates a subdirectory "subdir" in the
current directory
    }
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 20, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5759



--- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2011-03-20 10:16:24 PDT ---
Note: this was tested on Windows. I don't know if the behavior is the same on Linux.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
March 21, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5759


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX


--- Comment #2 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2011-03-20 17:34:02 PDT ---
std.path is probably being replaced, and apparently doesn't suffer from this problem. I'm closing it down.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------