Zipc.Fpath
File paths and modes.
ensure_directoryness p
makes sure p
ends with a '/'
. Returns "./"
on the empty string.
sanitize_path p
is a sanitized for path p
. This is either a relative path rooted in the current directory or the empty string. Directoryness (trailing '/'
) is suppressed and the function is not injective.
No effort is made to interpret relative segments correctly; a zip file with such paths is likely malice or clumsiness. More precisely this splits p
on '/'
and '\\'
, removes any "."
, ".."
or ""
segment (in particular this removes absolute paths) and concatenates the resulting list with "/"
.