一、声明
struct stat {
...
/* Since Linux 2.6, the kernel supports nanosecond
precision for the following timestamp fields.
For the details before Linux 2.6, see NOTES. */
struct timespec st_atim; /* Time of last access */
struct timespec st_mtim; /* Time of last modification */
struct timespec st_ctim; /* Time of last status change */
...
}
其实从上面的对这两个字段的说明就能很清楚的看出区别了。
- st_mtim,即last modify time。指的是文件数据上次修改时间
- st_ctim,即last change time。指的时文件状态信息的上次修改时间(即inode节点的上次更新时间)。