www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2552] New: std.path.isabs broken for Windows

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2552

           Summary: std.path.isabs broken for Windows
           Product: D
           Version: 1.030
          Platform: PC
               URL: http://www.digitalmars.com/d/1.0/phobos/std_path.html
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Phobos
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: darkuranium gmail.com


std.path.isabs(char[]) falsely reports paths as relative when they are, indeed,
absolute. For example:

isabs("/test") => 0 (should be 1)
isabs("\test") => 0 (should be 1)

Here is the program I used to test this -- see the comments in the source for
instructions (they are importaint):
http://paste.dprogramming.com/dpavbrtf

As you can see, although all paths are reported as relative, they are indeed
absolute.
This is visible by the fact that main.d cannot find test-rel which lies in the
same dir as the program itself.
It can, however find test-abs, which lies the root of the drive.


-- 
Jan 02 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2552







 std.path.isabs(char[]) falsely reports paths as relative when they are, indeed,
 absolute. For example:
 
 isabs("/test") => 0 (should be 1)
 isabs("\test") => 0 (should be 1)
The drives are lacking. In Windows terminology, does a drive-less path still qualify as absolute? (I looked around MSDN, couldn't find a good definition.) --
Jan 02 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2552






It's tricky.  Windows accepts such paths, and they are absolute to the current
drive, but relative to the entire filesystem.  Since the same path (like
"\foo\bar\baz.txt") can refer to different files based on what the current
drive is set to, I guess it's still relative, in which case Phobos is right.


-- 
Jan 02 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2552


Andrei Alexandrescu <andrei metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |andrei metalanguage.com
         AssignedTo|nobody puremagic.com        |andrei metalanguage.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 11 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2552


Andrei Alexandrescu <andrei metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |INVALID



14:22:27 PDT ---
I'll close this considering that isabs is correct as is.

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