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
I have a file accessible through \localhost\Test\test.txt.~SS. If I attempt to access that file using File.Open, I get an exception:
Unhandled Exception: System.IO.DirectoryNotFoundException: Could not find a part of the path 'o\t\Test\test.txt.~SS'.
at System.IO.Win32FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent)
at System.IO.Win32FileSystem.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, FileStream parent)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
at System.IO.File.Open(String path, FileMode mode)
at ConsoleApplication.Program.Main(String[] args)
Notice that the path that it is complaining about is mangled from the requested path. I have a repro available here. This works as expected using desktop framework but fails when targeting .NET CoreCLR. It also works as expected if I rename the file to test.txt.~sstmp.
Thoughts?
The text was updated successfully, but these errors were encountered:
After doing a bit of digging, I found that FileStream resolves the path using Path.GetFullPath. If I pass the in above file name into Path.GetFullPath, it returns the mangled name that is referenced in the above exception.
After looking a bit into Path.GetFullName, I would guess that the issue is that the file is incorrectly being handled as a short file name here. Should I close this bug and reopen in that repo?
I have a file accessible through \localhost\Test\test.txt.~SS. If I attempt to access that file using
File.Open
, I get an exception:Notice that the path that it is complaining about is mangled from the requested path. I have a repro available here. This works as expected using desktop framework but fails when targeting .NET CoreCLR. It also works as expected if I rename the file to test.txt.~sstmp.
Thoughts?
The text was updated successfully, but these errors were encountered: