You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Path functions behaving differently on UNC device paths than implied from documentation #95619
For device UNCs, the server/share portion forms the volume. For example, in \\?\server1\utilities\\filecomparer\, the server/share portion is server1\utilities. This is significant when calling a method such as Path.GetFullPath(String, String) with relative directory segments; it is never possible to navigate past the volume.
The way this reads to me is that \\?\server1\utilities\\ should be considered the "root" of \\?\server1\utilities\\filecomparer\.
Specifically, the documentation states
"the server/share portion forms the volume"
"in [...] the server/share portion is server1\utilities"
"...it is never possible to navigate past the volume"
This seems to not be respected:
Reproduction Steps
> dotnet fsi
Microsoft (R) F# Interactive version 12.4.0.0for F# 7.0
Copyright (c) Microsoft Corporation. All Rights Reserved.
For help type #help;;>openSystem.IO;;
> Path.GetFullPath("""..\..""","""\\?\server1\utilities\\filecomparer\""");;valit:string = "\\?\server1\"
Path.GetPathRoot(@"\\?\server1\utilities\\filecomparer\") returns empty string on .NET Framework. Path.GetFullPath(path, basePath) isn't supported on .NET Framework. So this is likely not a regression.
Activity
danmoseley commentedon Dec 5, 2023
FYI a good way to do a test on .NET Framework (ie to check old behavior) is http://sharplab.io (pick it from the drop-down)
s5bug commentedon Dec 5, 2023
It seems sharplab is not a fan of
System.IO.Path:Example Code
huoyaoyuan commentedon Dec 5, 2023
Path.GetPathRoot(@"\\?\server1\utilities\\filecomparer\")returns empty string on .NET Framework.Path.GetFullPath(path, basePath)isn't supported on .NET Framework. So this is likely not a regression.s5bug commentedon Dec 5, 2023
What about
Path.Combinefor .NET Framework, as shown in the example code?jozkee commentedon Dec 11, 2023
Path.Combine doesn't resolve relative segments, what you are referring to is being discussed in #2162.