【问题标题】:Does the order/direction of fsync matter?fsync 的顺序/方向重要吗?
【发布时间】:2011-11-10 19:35:51
【问题描述】:

假设我将一些文件和目录写入 USB 拇指驱动器。

/media/drive1/newFolder1/
/media/drive1/newFolder1/newfile1
/media/drive1/newFolder1/newfile2

我创建了一个文件夹newFolder1 和两个文件newfile1newfile2

同步不会自动发生,所以我需要 fsync 进行更改。

所以我需要在newFolder1newfile1newfile2 上致电fsync

问题是,我这样做的顺序重要吗?

【问题讨论】:

  • 这对你有什么影响?

标签: c++ fsync


【解决方案1】:

内容无关紧要,但如果在文件之后没有同步目录,则最后修改时间可能是错误的。

【讨论】:

    猜你喜欢
    • 2022-11-17
    • 2014-08-06
    • 2018-01-09
    • 2017-11-18
    • 2012-06-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多