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 guarantee that the data is actually physically written to disk.
Is there a .NET or Win32 method that can give me this guarantee? So if there is power loss one nanosecond after the call to this method comes back, I can still be sure that everything is OK?
Under Windows, look at FlushFileBuffers (Win32 API).