gpt4 book ai didi

python - 检查文件是否比其他文件更新?

转载 作者:太空狗 更新时间:2023-10-29 17:41:33 27 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
python: which file is newer & by how much time

在 python 中——我如何检查——文件是否比其他文件更新?

编辑:

有创建时间和修改时间。

问题应明确说明所需的属性。

修改

  • os.stat(FILE).st_mtime

  • os.path.getmtime(FILE)

创作

os.path.getctime(FILE)os.stat(FILE).st_ctime 在类 Unix 操作系统上不提供创建时间。 Link通过 root有关于如何在类 Unix 机器上找出创建时间的解决方案。

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com