文件修改时间和文件更改时间有什么区别?
时间:2020-03-05 18:57:52 来源:igfitidea点击:
我对术语文件修改时间和文件更改时间感到困惑。任何人都可以帮助使其更加清晰吗?
解决方案
回答
mtime是修改时间内容已更改。
ctime是状态更改时间的权限,所有权以及内容。
维基百科说:
* mtime: time of last modification (ls -l), * ctime: time of last status change (ls -lc) and * atime: time of last access (ls -lu). Note that ctime is not the time of file creation. Writing to a file changes its mtime, ctime, and atime. A change in file permissions or file ownership changes its ctime and atime. Reading a file changes its atime. File systems mounted with the noatime option do not update the atime on reads, and the relatime option provides for updates only if the previous atime is older than the mtime or ctime. Unlike atime and mtime, ctime cannot be set with utime() (as used e.g. by touch); the only way to set it to an arbitrary value is by changing the system clock.