Convert a path to a Windows extended length path.
(path: str)
| 133 | |
| 134 | |
| 135 | def get_extended_length_path_str(path: str) -> str: |
| 136 | """Convert a path to a Windows extended length path.""" |
| 137 | long_path_prefix = "\\\\?\\" |
| 138 | unc_long_path_prefix = "\\\\?\\UNC\\" |
| 139 | if path.startswith((long_path_prefix, unc_long_path_prefix)): |
| 140 | return path |
| 141 | # UNC |
| 142 | if path.startswith("\\\\"): |
| 143 | return unc_long_path_prefix + path[2:] |
| 144 | return long_path_prefix + path |
| 145 | |
| 146 | |
| 147 | def rm_rf(path: Path) -> None: |
no outgoing calls