从我在网上找到的文章看来,NTFS上的文件似乎有两种形式的唯一标识符:
>使用Windows API GetFileInformationByHandle(),我们可以访问结构BY_HANDLE_FILE_INFORMATION,其中包含卷序列号和低/高文件索引.
http://msdn.microsoft.com/en-us/library/aa363788(VS.85).aspx
> $Object_ID – 文章http://blogs.technet.com/b/askcore/archive/2010/08/25/ntfs-file-attributes.aspx声明:
$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.
我试图了解何时设置了对象ID.以下是一些问题:
>何时分配对象ID?根据上面的文章,在一种情况下,当创建文件的快捷方式时,会出现这种情况.
>当文件引用另一个文件时,是否自动分配对象ID,例如一个Word文档,嵌入Visio图表?
>只有在启用/运行分布式链接跟踪时才会分配对象ID,或者无论分布式链接跟踪如何,它们是否都存在?
>如果我想跟踪文件的唯一标识符,那么在组合的卷序列号和文件索引(低/高)上使用对象ID(64字节)是否有任何好处,它们组合为12个字节.
谢谢,Elan