Closed Ash014 closed 6 years ago
It seems that the text: "[Unknown]" is inside .NET: IO_UnknownFileName = [Unknown]
Unfortunately, I failed to figure out why this value is returned.
It seems you can use this to still get the full path:
using (var fs = Alphaleonis.Win32.Filesystem.File.Open(filepath, FileMode.Open, FileAccess.ReadWrite, FileShare.None))
{
var path = Alphaleonis.Win32.Filesystem.Path.GetRegularPath(Alphaleonis.Win32.Filesystem.Path.GetFinalPathNameByHandle(fs.SafeFileHandle));
Console.WriteLine(path);
}
I'm trying to use AlphaFS in order to replace System.IO in my application.
I have a different behavior when I use System.IO.File.Open() and Alphaleonis.Win32.Filesystem.File.Open(). The variable "Name" of FileStream object indicates "Unknow" with Alphaleonis.Win32.Filesystem lib while the System.IO lib indicates the full path of my file.
FileStream fs = Alphaleonis.Win32.Filesystem.File.Open(filepath, System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite, System.IO.FileShare.None);
fs.Name => "Unknow"
FileStream fs = System.IO.File.Open(filepath, System.IO.FileMode.Open, System.IO.FileAccess.ReadWrite, System.IO.FileShare.None);
fs.Name => "C:/....."
Do you have an idea to solve that?