小编use*_*234的帖子

修改文件内容时ctime发生变化的原因

我知道当文件元数据或文件内容更改时 ctime 会更改,文件内容修改时 mtime 会更改。

我想知道当文件内容改变时更新ctime的原因,我们不是已经有mtime跟踪了吗?

在我的 MAC 上

usxxkothan3m1:temp kothan3$ touch foo.txt
usxxkothan3m1:temp kothan3$ stat -x foo.txt
  File: "foo.txt"
  Size: 0            FileType: Regular File
  Mode: (0644/-rw-r--r--)         Uid: (276196474/ kothan3)  Gid: (720748206/CORP\Domain Users)
Device: 1,4   Inode: 11745569    Links: 1
Access: Mon Aug 24 11:59:07 2015
Modify: Mon Aug 24 11:59:07 2015
Change: Mon Aug 24 11:59:07 2015
usxxkothan3m1:temp kothan3$ echo "write something here" >> foo.txt
usxxkothan3m1:temp kothan3$ stat -x foo.txt
  File: "foo.txt"
  Size: 21           FileType: Regular File
  Mode: (0644/-rw-r--r--)         Uid: …
Run Code Online (Sandbox Code Playgroud)

filesystems timestamps files

5
推荐指数
1
解决办法
1534
查看次数

标签 统计

files ×1

filesystems ×1

timestamps ×1