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
Comment #1 by dlang-bot — 2021-07-29T19:26:29Z
@lucica28 created dlang/phobos pull request #8182 "[DSSv3] Fix issue 20865 - add function isSubPath" fixing this issue:
- Fix issue 20865 - add function isSubPath
https://github.com/dlang/phobos/pull/8182
Comment #2 by robert.schadek — 2024-12-01T16:36:49Z