sanitizePath
fn
string sanitizePath(string path, bool allowTraversal = false)Sanitize a path for archive use.
Normalizes path separators and validates safety. On Windows, also checks for reserved device names.
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.