uce/site/doc/pages/path_is_within.txt
2026-06-16 12:21:31 +00:00

18 lines
447 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`.
:example
print("path_is_within example\n");