Does Windows have Inode Numbers like Linux?

后端 未结 7 1481
挽巷
挽巷 2020-12-02 19:38

Does Windows have Inode Numbers like Linux? How does Windows internally manage files?

相关标签:
7条回答
  • 2020-12-02 20:16

    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.

    0 讨论(0)
  • 2020-12-02 20:16

    No. There is no equivalent to inodes in NTFS. Inode is with **IX based file systems.

    But yes, NTFS stores a unique 8-byte reference number for each file.

    Comment if you want to know more details.

    0 讨论(0)
  • 2020-12-02 20:19

    There are two things here. The term INode, and a file-system implementation that uses either INode terminology or something like INode in its place.

    All Windows file-systems(FAT*,NTFS) I know of, use Inode-like structures in actual implementation.

    To further simplify the answer

    (Think of INode as a block of metadata about a file.)

    INode as term : No windows file system dont have it.

    INode as concept : Windows will have some other structures, similar in property and usage but used with different name

    0 讨论(0)
  • 2020-12-02 20:30

    This question is more about filesystems than a particular OS I believe. Each filesystem handles files differently (and each OS can support multiple filesystems).

    http://pcnineoneone.com/howto/filesystems1/ has a pretty good writeup on FAT and NTFS, which are two popular filesystems with windows.

    0 讨论(0)
  • 2020-12-02 20:30

    Inodes are a POSIX concept. Modern Windows versions use NTFS. An in-depth description of NTFS: Inside NTFS

    0 讨论(0)
  • 2020-12-02 20:31

    Yes it does. Generally called fileID. Try this in a Win8 command shell:

    fsutil file queryfileid  <filename>
    
    0 讨论(0)
提交回复
热议问题