Does Linux guarantee the contents of a file is flushed to disc after close()?

From “man 2 close“:

A successful close does not guarantee that the data has been
successfully saved to disk, as the
kernel defers writes.

The man page says that if you want to be sure that your data are on disk, you have to use fsync() yourself.

Leave a Comment