-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Path functions behaving differently on UNC device paths than implied from documentation #95619
Comments
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) |
It seems sharplab is not a fan of
using System;
using System.IO;
Console.WriteLine(
Path.Combine("\\\\?\\server1\\utilities\\\\filecomparer\\", "..\\..")
); |
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsDescriptionFile path formats on Windows systems states:
The way this reads to me is that Specifically, the documentation states
This seems to not be respected: Reproduction Steps> dotnet fsi
Microsoft (R) F# Interactive version 12.4.0.0 for F# 7.0
Copyright (c) Microsoft Corporation. All Rights Reserved.
For help type #help;;
> open System.IO;;
> Path.GetFullPath("""..\..""", """\\?\server1\utilities\\filecomparer\""");;
val it: string = "\\?\server1\" Expected behavior> Path.GetFullPath("""..\..""", """\\?\server1\utilities\\filecomparer\""");;
val it: string = "\\?\server1\utilities\\"
> Path.GetPathRoot("""\\?\server1\utilities\\filecomparer\""");;
val it: string = "\\?\server1\utilities\\"
> Path.GetDirectoryName("""\\?\server1\utilities\\""");;
val it: string = <null> Actual behavior> Path.GetFullPath("""..\..""", """\\?\server1\utilities\\filecomparer\""");;
val it: string = "\\?\server1\"
> Path.GetPathRoot("""\\?\server1\utilities\\filecomparer\""");;
val it: string = "\\?\server1\"
> Path.GetDirectoryName("""\\?\server1\utilities\\""");;
val it: string = "\\?\server1\utilities" Regression?I don't know how to test old .NET versions, I'm not a long-time .NET user. Known WorkaroundsNo response Configuration
I would be pretty sure it's Windows (Path)-specific. Other informationNo response
|
|
What about |
Path.Combine doesn't resolve relative segments, what you are referring to is being discussed in #2162. |
Description
File path formats on Windows systems states:
The way this reads to me is that
\\?\server1\utilities\\
should be considered the "root" of\\?\server1\utilities\\filecomparer\
.Specifically, the documentation states
server1\utilities
"This seems to not be respected:
Reproduction Steps
Expected behavior
Actual behavior
Regression?
I don't know how to test old .NET versions, I'm not a long-time .NET user.
Known Workarounds
No response
Configuration
I would be pretty sure it's Windows (Path)-specific.
Other information
No response
The text was updated successfully, but these errors were encountered: