Path.relativeTo

Path relativeTo(Path other) const @safe

Compute the relative path from other to this (pathlib-like).

If this.isRelativeTo(other) is false, throws an Exception with a clear message explaining the mismatch (different anchors or other not a prefix).

Returns

A relative Path. When both paths are the same, returns Path(".").
Path relativeTo(string other) const @safe

Overload taking a string base