Does Windows have Inode Numbers like Linux?
Solution 1:
The terminology used is a bit different from what you'd find in the Unix world, however in terms of having an integer that uniquely identifies a file, NTFS and some Windows API expose the concept of "file IDs" which is similar.
You can query the file ID of an open handle via GetFileInformationByHandle
. See nFileIndexHigh
, nFileIndexLow
; this is the high and low parts respectively of the file ID which is 64 bits.
NtCreateFile
can also open a file by its ID. See the FILE_OPEN_BY_FILE_ID
flag. You need a volume handle to open by file ID.
Solution 2:
Yes it does. Generally called fileID
. Try this in a Win8 command shell:
fsutil file queryfileid <filename>
Solution 3:
Yes. NTFS uses a B-Tree indexing system. Every file in the MFT has a 64 bit File Index Number. This number, called the File ID, uniquely identifies the file ONLY WITHIN ITS VOLUME. I.e., two files on two separate volumes on the same PC may have the same File ID. See this MSDN article for more details.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa363788(v=vs.85).aspx
regarding your second question, "how does windows internally manage files", see this technet article:
https://technet.microsoft.com/en-us/library/cc781134(v=ws.10).aspx