[Issue 2322] New: Wrong behavior of std.path.dirname() in Windows

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 29 21:51:47 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2322

           Summary: Wrong behavior of std.path.dirname() in Windows
           Product: D
           Version: 2.018
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: snake.scaly at gmail.com


Windows version of dirname() sometimes gives incorrect results:

dirname(r"\foo") -> "."
The "\foo" path is relative to the root of the current drive. The correct
dirname for "\foo" is "\" which is the root of the current drive.

dirname(r"c:\foo") -> "c:"
Windows maintains separate working directories for each drive. "c:" refers to a
working directory for drive "C". The correct dirname for "c:\foo" is "c:\"
which is the root of drive "C".


-- 



More information about the Digitalmars-d-bugs mailing list