c - How do I modify every timestamp of file on unix EXT4? - Stack Overflow

I am writing a C program that requires me to change every timestamp of a file (aTime, mTime, cTime, and

I am writing a C program that requires me to change every timestamp of a file (aTime, mTime, cTime, and bTime/crTime) to nanosecond precision.

If I were to do this in terminal, I would run

debugfs -w -R "set_inode_field <[file_inode]> crtime @[time]" [dev_path]
debugfs -w -R "set_inode_field <[file_inode]> crtime_extra [extra]" [dev_path]

But I cannot find a good way to run debugfs in a C program.

I am aware of using utimensat to modify aTime and mTime in code, but do not know of anything for aTime or bTime/crTime.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743735352a4498158.html

相关推荐

  • c - How do I modify every timestamp of file on unix EXT4? - Stack Overflow

    I am writing a C program that requires me to change every timestamp of a file (aTime, mTime, cTime, and

    6天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信