J
Jeff Johnson
Given two file paths, I would like to determine with certainty whether those
paths refer to the same physical file. Now, there is Path.GetFullPath(), and
that's very helpful. But what if I refer to a file on my machine through a
UNC path? Example:
C:\Temp\123.txt
\\MYCOMP\DRIVE_C\Temp\123.txt
\\MYCOMP\DRIVE_C is a share mapped to C:\, so ultimately both these paths
point to the same physical file. Does the .NET Framework provide any means
of mapping this? Please note that I don't in any way expect to get local
path translation for a REMOTE server, but I think it ought to be available
when a UNC path points to the LOCAL machine. If .NET offers nothing
built-in, does anyone know of a Windows API function that might do this?
I realize that I could enumerate shares and do all the heavy lifting myself;
I was just wondering if this sort of mapping is already written and
available to me.
paths refer to the same physical file. Now, there is Path.GetFullPath(), and
that's very helpful. But what if I refer to a file on my machine through a
UNC path? Example:
C:\Temp\123.txt
\\MYCOMP\DRIVE_C\Temp\123.txt
\\MYCOMP\DRIVE_C is a share mapped to C:\, so ultimately both these paths
point to the same physical file. Does the .NET Framework provide any means
of mapping this? Please note that I don't in any way expect to get local
path translation for a REMOTE server, but I think it ought to be available
when a UNC path points to the LOCAL machine. If .NET offers nothing
built-in, does anyone know of a Windows API function that might do this?
I realize that I could enumerate shares and do all the heavy lifting myself;
I was just wondering if this sort of mapping is already written and
available to me.