st_ino
, st_dev
, st_nlink
, st_uid
, and st_gid
are dummy variables on Windows 7 SP1 through Python 2.7.11:
import os; os.stat('Desktop\test.txt')
nt.stat_result(st_mode=33206, st_ino=0L, st_dev=0L, st_nlink=0, st_uid=0, st_gid=0, st_size=293L, st_atime=1448376581L, st_mtime=1451782006L, st_ctime=1448376581L)
However, they appear to be filled with meaningful values in Windows 7 SP1 as of Python 3.5.1:
import os; os.stat('Desktop\test.txt')
os.stat_result(st_mode=33206, st_ino=17732923532870243, st_dev=2289627604, st_nlink=2, st_uid=0, st_gid=0, st_size=293, st_atime=1448376581, st_mtime=1451782006, st_ctime=1448376581)
The Python docs on this topic would lead a sane user to avoid ever using os.stat
in Windows, since there's no guarantee that any field will always/ever be accurate. In practice, it looks like st_size
, st_atime
, st_mtime
, and st_ctime
are usually if not always accurate. The other fields depend on at least the Python version, probably also the Windows version, and possibly other factors.