What k开发者_StackOverflowind of object is nt.stat_result
?
nt.stat_result(st_mode=33206, st_ino=0L, st_dev=0, st_nlink=0, st_uid=0, st_gid=0, st_size=0L, st_atime=1305043675L, st_mtime=1305043677L, st_ctime=1305043675L)
I see that I can access each element by dot notation. But can't understand what is all this about.
Not sure what you mean by object type.
Running help(nt)
in the my IDLE environment on Windows displays the below help text:
class stat_result(__builtin__.object) | stat_result: Result from stat or lstat. | | This object may be accessed either as a tuple of | (mode, ino, dev, nlink, uid, gid, size, atime, mtime, ctime) | or via the attributes st_mode, st_ino, st_dev, st_nlink, st_uid, and so on.
You can try the same on your windows box and read the complete help. The help text mentions that the field st_ino indicates the inode number of the file , you can refer to help of nt
module for description of other attributes.
My best guess would be: this is a result, returned from os.stat call on windows. Check the os.stat
documentation for the meaning.
As with other python classes of a similiar nature, it behaves similarly to the namedtuple class in the collections module introduced in python 2.6. Looking at the documentation helped me in accessing and working with objects like nt.stat_result.
精彩评论