Path.relative_to
You're seeing just the function
relative_to
, go back to Path module for more information.
Specs
Returns the given path
relative to the given from
path.
In other words, this function tries to strip the from
prefix from path
.
This function does not query the file system, so it assumes no symlinks between the paths.
In case a direct relative path cannot be found, it returns the original path.
Examples
iex> Path.relative_to("/usr/local/foo", "/usr/local")
"foo"
iex> Path.relative_to("/usr/local/foo", "/")
"usr/local/foo"
iex> Path.relative_to("/usr/local/foo", "/etc")
"/usr/local/foo"
iex> Path.relative_to("/usr/local/foo", "/usr/local/foo")
"."