pub fn path_to_safe_dirname(path: &str) -> StringExpand description
Convert a remote path to a safe directory name.
Sanitizes path by:
- Removing leading
~and/ - Replacing path separators and spaces with underscores
- Removing parent directory references (
..) to prevent traversal attacks - Removing current directory references (
.) - Appending a stable hash to prevent collisions (e.g., “foo/bar” vs “foo_bar”)