caf*_*caf 11
使用该stat()功能.在glibc的最新版本中,st_mtim(注意:没有尾随e)是一个struct timespec包含文件修改时间的类型字段:
struct stat st;
if (stat(filename, &st)) {
perror(filename);
} else {
printf("%s: mtime = %lld.%.9ld\n", filename, (long long)st.st_mtim.tv_sec, st.st_mtim.tv_nsec);
}
Run Code Online (Sandbox Code Playgroud)
您应该检查构建系统中是否存在st_mtimin struct stat,并且如果不存在,则准备好回退st_mtime(具有类型time_t,只有1秒分辨率).
| 归档时间: |
|
| 查看次数: |
15655 次 |
| 最近记录: |