Full file ID API in Win32

In order to get the full ID of a file in Win32 the GetFileInformationByHandle  returning a BY_HANDLE_FILE_INFORMATION which contains 64 bits of file ID (and the volume id where the file resides) is a start.

The GetFileInformationByHandleEx  with FILE_INFO_BY_HANDLE_CLASS of returns FILE_ID_INFO which provides the full (potentially) 128 bit file id as required for ReFS.

I’ll likely provide support for both of these shortly, likely using C++/CLI to simplify the interface.

Given these two pieces of information it should  be much safer to clear out duplicate files as various sorts of links and mount points will still show the ultimate file identity properly and avoid deleting apparent duplicates that are really just aliased paths to the same file.

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.