On 25 ene, 10:28, asit <[EMAIL PROTECTED]> wrote: > why this program shows ambiguous behavior ?? > > st=os.stat(file_name) > print "file size", "=>",st[stat.ST_SIZE] > print "inode number", "=>",st[stat.ST_INO] > print "device inode resides on", "=>",st[stat.ST_DEV] > print "number of links to this inode", "=>",st[stat.ST_NLINK] > > i ran this program in Winows XP SP2 in python 2.5.
Using my recently repaired crystal ball, I see that you don't get what you expect for some of those fields. All files sharing the same inode, by example. The usual file systems used by Windows aren't built around the inode concept, they're different, so there is no "inode number" to report, among other things. From http://docs.python.org/lib/os-file-dir.html "On Windows, some items are filled with dummy values". Don't rely on anything but st_mode, st_size, and st_[cma]time, and perhaps a few more for fstat. -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list