Convert a path to a Windows extended length path.
(path: str)
| 147 | |
| 148 | |
| 149 | def get_extended_length_path_str(path: str) -> str: |
| 150 | """Convert a path to a Windows extended length path.""" |
| 151 | long_path_prefix = "\\\\?\\" |
| 152 | unc_long_path_prefix = "\\\\?\\UNC\\" |
| 153 | if path.startswith((long_path_prefix, unc_long_path_prefix)): |
| 154 | return path |
| 155 | # UNC |
| 156 | if path.startswith("\\\\"): |
| 157 | return unc_long_path_prefix + path[2:] |
| 158 | return long_path_prefix + path |
| 159 | |
| 160 | |
| 161 | def rm_rf(path: Path) -> None: |
no outgoing calls