www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5759] New: std.path.join incorrectly joins directories

reply d-bugmail puremagic.com writes:
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



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: -------
Mar 20 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=5759




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: -------
Mar 20 2011
prev sibling parent d-bugmail puremagic.com writes:
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



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: -------
Mar 20 2011