Is ctime always <= mtime?

前端 未结 5 1100
旧时难觅i
旧时难觅i 2021-02-14 13:38

When using os.stat() in Python, can I assume that st_ctime is always less then or equal to st_mtime? If not, why not?

The code will always run on Linux, but if there is

5条回答
  •  悲哀的现实
    2021-02-14 14:07

    It's entirely possible to set both values programmatically. You might also be able to have this happen "naturally" by setting the clock back to before the file was created.

    In other words, yes. It would be unusual but is entirely possible.

提交回复
热议问题