www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20865] New: Add std.path : isSubPath

https://issues.dlang.org/show_bug.cgi?id=20865

          Issue ID: 20865
           Summary: Add std.path : isSubPath
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: andre s-e-a-p.de

Could you add a function isSubPath to std.path?

assert("/opt".isSubPath("/opt/sub"));
assert("/opt".isSubPath("/lib") == false);

To be considered:
- What is the result of isSubPath("/opt", "/opt")
- Path and subPath needs to be resolved to absolute paths and on
  *ix system ~ needs to be resolved

--
May 26