python - 在 Linux 上使用 Python 获取文件创建时间

标签 python linux

os.stat 返回 st_mtime 和 st_ctime 属性,修改时间是 st_mtime 和 st_ctime 在 POSIX 上的“更改时间”。 有没有使用python和Linux下返回文件创建时间的函数?

最佳答案

You probably can't. :

3.1)  How do I find the creation time of a file?

      You can't - it isn't stored anywhere.  Files have a last-modified
      time (shown by "ls -l"), a last-accessed time (shown by "ls -lu")
      and an inode change time (shown by "ls -lc"). The latter is often
      referred to as the "creation time" - even in some man pages -
      but that's wrong; it's also set by such operations as mv, ln,
      chmod, chown and chgrp.

      The man page for "stat(2)" discusses this.

关于python - 在 Linux 上使用 Python 获取文件创建时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1408272/

相关文章:

python - 在 boost python 中创建列表列表

linux - 从子文件中的母文件中搜索一个数字,并将子文件中的完整行追加到母文件中

python - RandomForest 和 XGB 为什么/如何?有什么办法可以解决这个问题吗?

python - 如何在 PySimpleGUI 中清除窗口

python - 为什么这个巨大的(非稀疏的)numpy 矩阵适合 RAM

linux - 使用 apache 虚拟主机时,谷歌浏览器中的配置 header 显示错误

linux - 解析虚拟主机 apache 2

linux - 使用 VMWare 安装作为开发网络服务器

c++ - 在 Mac OS X Mountain Lion(或更高版本)和 Linux 上使用 X11/Xlib.h

python - ttk.Entry.select_range() 适用于 Button,但不适用于 python/tkinter 中的 ttk.Button?