Is there a way to find the filename based on a filehandle in c#?
I have a IntPtr containing a filehandle to an open file, and I want to know what the name of that file is.
I did not open the file myself, and only have a function that receives the handle. But I am only interested in processing some files, based on how they are named.
The attached code always prints [Unknown]
SafeFileHandle sh = new SafeFileHandle(InFile, false);
FileStream f = new FileStream(sh, FileAccess.Read);