If you use dunce::simplified(path)
it will strip UNC only by manipulating the string, without accessing the disk, or even calling any Windows APIs....
Note that if I try to open such drive for example from my emacs editor, the same freeze happens, just as long.
-
c523a1ed · Bump
- ... and 2 more commits. Compare 360e293d...c523a1ed
-
360e293d · Extension should start at the first dot
- ... and 3 more commits. Compare 1ee29a83...360e293d
closed
issue
#5
"Support for network paths like `\\\\?\\UNC\\Mac\\Home\\dev\\github.com\\`…"
at
Kornel / dunce
commented on
issue #6
"Will dunce convert volume paths to canonical paths in windows"
at
Kornel / dunce
No, this is not supported. This crate only trims \\C:\
paths.
It is likely a issue of the standard library since std::fs::canonicalize
also failed to process such a mounted path.
-
1ee29a83 · Bump
- ... and 1 more commit. Compare 03478410...1ee29a83
-
03478410 · Bump
- ... and 4 more commits. Compare e409d1c6...03478410
Good point, this actually helps a lot! As you might be able to tell, I'm not super-familiar with UNC paths....
I think you could check if the path still starts with double slash.