前几天,我搜索并询问了一些关于文件不同时间戳的问题。
现在我知道,我可以通过
creation time
获取 statx(2)
并通过 only
和 last (status change | modification | access) time
命令/实用程序更改 touch -m
文件的 debugfs
之一,而无需更改其他时间。
我想知道,如何更改每个
last (status change | modification | access) time
而不更改其他时间only by system call
而不是通过任何命令/实用程序。如果不可能,这些命令/实用程序如何做到这一点?
我知道
Criticism of atime.
谢谢
futimens()
及其近亲futimensat()
:
#include <sys/stat.h>
int futimens(int fd, const struct timespec times[2]);
特别是,它们支持特殊时间值
UTIME_OMIT
来指示“不要更改此时间字段”。