os.stat('<filename>')[stat.ST_INO] on Windows

"Martin v. Löwis" martin at v.loewis.de
Thu Mar 3 10:21:22 CET 2005


Tim Roberts wrote:
> Hmmm, yes, but nearly 100% of Unix geeks have seen an inode number in their
> programming adventures, whereas I'll bet not 1 in 10,000 Windows hardliners
> has ever seen an MFT entry.

That is going to change. At my university, students learn what an MFT
record is and how it is structured as part of the operating system
course, just as they learn what an inode is.

I'll grant you that a MFT records are less visible, primarily because
people don't do hard links all that often. That might be changing as
well.

> There are things you can do with an inode number, but there's nothing you
> can do with an MFT ordinal.

Like what? On NTFS and Win32, you can even convert an inode number
efficiently back to a path name (actually, all path names), something
you cannot do on a typical Unix system (atleast not efficiently).

> So, I'll grant that my answer was too specific, but I still believe the
> answer to the original question is "no".

Yes, but that's the stupidity of the MS C library, which doesn't use
the nFileIndexHigh/nFileIndexLow fields of the
BY_HANDLE_FILE_INFORMATION structure (it also is the stupidity of the
Win32 API, which claims that you need an open file to support the
notion of a file identifier).

Regards,
Martin



More information about the Python-list mailing list