os.stat(path)
Perform the equivalent of a stat() system call on the given path. (This function follows symlinks; to stat a symlink use lstat().)
The return value is an object whose attributes correspond to the members of the stat structure, namely:
st_mode - protection bits,
st_ino - inode number,
st_dev - device,
st_nlink - number of hard links,
st_uid - user id of owner,
st_gid - group id of owner,
st_size - size of file, in bytes,
st_atime - time of most recent access,
st_mtime - time of most recent content modification,
st_ctime - platform dependent; time of most recent metadata change on Unix, or the time of creation on Windows)
你可以像那样直接使用Windows API
如果您使用的是python 3.4+,则可以使用pathlibstat方法。
输出:
here is more information about os.stat_result
你需要看看模块
stat
和os.stat
相关问题 更多 >
编程相关推荐