【问题标题】:What is the difference between file modification time and file changed time?文件修改时间和文件更改时间有什么区别?
【发布时间】:2010-09-09 22:30:34
【问题描述】:

我对文件修改时间和文件更改时间这两个术语感到困惑。谁能帮忙说清楚点?

【问题讨论】:

  • 我们需要的是一个系统调用列表,每个系统调用都会改变:-)

标签: operating-system filesystems


【解决方案1】:

mtime 是修改时间 - 内容已更改。

ctime 是状态更改时间 - 权限和所有权以及内容。

Wikipedia 说:

* mtime: time of last modification (ls -l),
* ctime: time of last status change (ls -lc) and
* atime: time of last access (ls -lu).

注意ctime不是时间 文件创建。写入文件 更改其 mtime、ctime 和 atime。一种 更改文件权限或文件 所有权更改其 ctime 和 atime。 读取文件会改变它的时间。文件 使用 noatime 安装的系统 选项不更新时间 读取,以及 relatime 选项 仅在以下情况下提供更新 以前的 atime 比 mtime 早 或 ctime。与 atime 和 mtime 不同, ctime 不能用 utime() 设置(如 使用例如通过触摸);唯一的办法 将其设置为任意值是 更改系统时钟。

【讨论】:

  • 注意还有一个层次结构: - 修改:mtime、ctime 和 atime 都改变了。 - 状态改变:ctime 和 atime 改变。 - 访问:仅更改时间。
猜你喜欢
  • 2014-03-11
  • 2011-01-15
  • 2017-03-30
  • 2010-09-23
  • 2015-04-04
  • 1970-01-01
  • 2022-07-02
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多