relativize

abstract suspend fun relativize(root: Path, path: Path): String?(source)

Relativizes the given path path based on the specified root path. This function calculates the relative path from the root to the path.

Return

A string representing the relative path from the root to the path, or null if the paths cannot be relativized.

Parameters

root

The base path against which the relative path should be computed.

path

The target path to compute its relation to the root.