sanitizePath
fn
string sanitizePath(string path, bool allowTraversal = false)Sanitize a path for archive use.
Normalizes path separators and validates safety, including Windows reserved device names (archive entries are cross-platform data, so the reserved-name check runs on every platform).
Parameters
path | The path to sanitize. |
allowTraversal | Whether to allow ".." components. |
Returns
The sanitized path.
Throws
ArchiveError with PATH_ERROR if the path is unsafe.