When is it necessary to flush a file?
I never do it because I call File.Close and I think that it is flushed automatically, isn\'t it?
See here. File.Sync()
is syscall to fsync. You should be able to find more under that name.
Keep in mind that fsync
is not the same as fflush and is not executed before close.
You generally don't need to call it. The file will be written to disk anyway, after some time and if there is no power failure during this period.