Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Windows have Inode Numbers like Linux?

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

like image 854
Gautam Bhalla Avatar asked Aug 23 '11 13:08

Gautam Bhalla


People also ask

What is inode number in OS?

An inode is a data structure in UNIX operating systems that contains important information pertaining to files within a file system. When a file system is created in UNIX, a set amount of inodes is created, as well. Usually, about 1 percent of the total file system disk space is allocated to the inode table.

Which file systems use inodes?

The inode (index node) is a data structure in a Unix-style file system that describes a file-system object such as a file or a directory.

How do I find my inode number?

Use the command df-i to pull basic data about your inode usage, including the file system on which the inodes are stored, your total inode count, how many are in use (in count and %), and how many remain. Use -inum to find files associated with a certain inode. Inversely, use ls-i to get the inode number of a file.

Do directory files have inode number?

Every file and directory requires an inode, and because every file is in a directory, every file also requires a directory structure. Directory structures are also called directory entries, or “dentries.” Each inode has an inode number, which is unique within a file system.


4 Answers

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.

like image 55
asveikau Avatar answered Oct 17 '22 14:10

asveikau


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

fsutil file queryfileid  <filename>
like image 22
Buai Avatar answered Oct 17 '22 13:10

Buai


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

like image 21
Andrew Howlett Avatar answered Oct 17 '22 14:10

Andrew Howlett


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

like image 7
Ajeet Ganga Avatar answered Oct 17 '22 14:10

Ajeet Ganga