relativeTo


Description:

public Path? relativeTo (Path base_path)

Computes the relative path from the given base path to this path.

Both paths are normalized before computing the relative path. If the base is null, returns null.

Example:

    var path = new Path ("/home/user/docs/file.txt");
var base_path = new Path ("/home/user");
var rel = path.relativeTo (base_path);
assert (rel != null);
assert (rel.toString () == "docs/file.txt");

Parameters:

base_path

the base path to compute relative to.

Returns:

a new relative Path, or null if base is null.