How do you read the 128-bit NTFS FILE_ID for a directory and/or file?

后端 未结 2 1598
温柔的废话
温柔的废话 2021-01-01 00:02

So NTFS uses a 128-bit Guid to identify files and directories, you can view this information easily enough:

C:\\Temp>C:\\Windows\\System32\\fsutil.exe objectid qu         


        
2条回答
  •  醉话见心
    2021-01-01 00:31

    A bit of searching took me to DeviceIoControl and there lies the answer to your question: FSCTL_GET_OBJECT_ID returns exactly the same IDs as in your output from fsutil.

    Anyhow, the docs for BY_HANDLE_FILE_INFORMATION say that the 64-bit file ID already uniquely identifies a file on a given volume. According to Wikipedia, NTFS only supports a maximum of 2^32 files, so the 128-bit ID seems quite unnecessary.

提交回复
热议问题