From articles I have found online there appears to be two forms of unique identifiers for files on NTFS:
Using Windows API GetFileInformationByHandle(), we can get access to the struct BY_HANDLE_FILE_INFORMATION, which contains a volume serial number and a low/high file index. http://msdn.microsoft.com/en-us/library/aa363788(VS.85).aspx
$Object_ID - The article http://blogs.technet.com/b/askcore/archive/2010/08/25/ntfs-file-attributes.aspx states:
$OBJECT_ID – This is an attribute that holds an ID. This ID is used by the Distributed Link Tracking Service. An example of how it is used would be found in shortcuts. Make a shortcut on your desktop that points to a file. Then move that file. The shortcut will still function because it is using a way to tack the source file other than just the path and file name.
Not all files will have an $OBJECT_ID attribute. In fact, it isn’t until an actual ID is to be assigned that the attribute is added to the file.
I am trying to understand when the Object ID is set. Here are a few questions:
When does the Object ID get assigned? It would appear based on the above article that in one scenario this occurs when a shortcut to a file is created.
Does the Object ID get assigned automatically when a file references another file, e.g. a Word document, which embeds a Visio diagram?
Do Object IDs only get assigned when Distributed Link Tracking is enabled/running or do they exist regardless of Distributed Link Tracking?
If I wanted to track a unique identifier for a file, would there be any advantage for me to use the Object ID (64 bytes) over the combined volume serial number and file index (low/high), which are 12 bytes combined.
Thanks, Elan