How to ensure all data has been physically written to disk?

后端 未结 7 1209
执念已碎
执念已碎 2020-11-27 05:44

I understand that .NET FileStream\'s Flush method only writes the current buffer to disk, but dependent on Windows\' disk driver and the hard disk firmware this is no guaran

7条回答
  •  悲哀的现实
    2020-11-27 06:08

    There's simply too many levels of abstraction to be absolutely sure that the data is written to the disc, right down to the hardware level.

    Not brilliantly performant or foolproof, but how about re-opening the file once it is written in a seperate process and checking the size or contents?

提交回复
热议问题