mtime vs ctime vs atime

mtime, atime and ctime are timestamps associated with the modification, access and change of any file respectively.

mtime
mtime (modification time) indicates the time the contents of the file has been changed. Mind you, only the contents. Not the attributes. For instance, if you open a file and change some (or all) of its content, its mtime gets updated. If you change a file's attribute (like read-write permissions, metadata), its mtime doesn't change, but ctime will.

atime
atime (access time) is the timestamp that indicates the time that a file has been accessed. The file may have been opened by you, or may have been accessed by some other program or a remote machine. Anytime a file has been accessed, its access time changes.

ctime
ctime (change time) is the timestamp of a file that indicates the time that it was changed. Now, the modification can be in terms of its content or in terms of its attributes. Whenever anything about a file changes (except its access time), its ctime changes.

In general, mtime <= ctime <= atime

posted @   小张的练习室  阅读(138)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示