I am flabbergasted by the definition of the inode number:
An inode is a data structure on a traditional Unix-style file system such as UFS or ext3. An inode stores basic information about a regular file, directory, or other file system object. Source
So there must be a logical order in every inode number. Can you conclude something directly from the numbers in the front?
4214970 0 drwx------ 102 user staff 3.4K Feb 2 22:34 new
5728909 0 drwx------ 3 user staff 102B Mar 25 22:11 new_new
5415906 0 drwx------ 15 user staff 510B Mar 19 02:28 stdout_TEST
If not, what kind of things you can know thanks to the data structure?
An inode number is not an inode. :) You can think of the inode number as the inode's primary key.
As for how the inode numbers are decided, it depends on the filesystem. Some filesystems might even make inode numbers out of thin air (particularly some FUSE filesystems). Other times it may map directly to the location on disk. The unfortunate fact is, it's a somewhat outdated concept, and many modern filesystems have difficulty compacting their internal location information into a 32-bit number these days.
In any case, as an application programmer, one should treat the inode number as an opaque value, suitable for equality comparison only (and only if you're sure the file wasn't deleted, as inode numbers may be reused...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With