15 lines
402 B
Plaintext
15 lines
402 B
Plaintext
:sig
|
|
bool path_is_within(String path, String root)
|
|
|
|
:params
|
|
path : path to test
|
|
root : containing directory
|
|
return value : true when both paths canonicalize and `path` is equal to or inside `root`
|
|
|
|
:see
|
|
>sys
|
|
>path_real
|
|
|
|
:content
|
|
Performs canonical containment on the host. It resolves `..`, symlinks, and trailing slash differences before comparing, so `/foo/bar2` is not considered inside `/foo/bar`.
|