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

"Martin v. Löwis" martin at v.loewis.de
Sun Feb 27 18:26:13 EST 2005


jepler at unpythonic.net wrote:
  > Refer to the operating system documentation (msdn.microsoft.com?). 
os.stat is
> mostly a wrapper around whatever the OS provides.  A quick glance at Python
> source code shows that maybe _stati64() or _wistat64() is the actual function
> used on windows.

That doesn't really help: MSDN says

"""Number of the information node (the inode) for the file 
(UNIX-specific). On UNIX file systems, the inode describes the file date 
and time stamps, permissions, and content. When files are hard-linked to 
one another, they share the same inode. The inode, and therefore st_ino, 
has no meaning in the FAT, HPFS, or NTFS file systems.
"""

So we know it has no meaning, but they won't tell us what its value is.
Fortunately, MS ships the source of the CRT in VC, so we know st_ino
is always 0 (as are st_uid and st_gid).

Regards,
Martin




More information about the Python-list mailing list