Re this quetion: Does close() call fsync() on Linux?
This question describes that close() (c lib) does not call sync on linux.
Is this the same for fstream::close()?:
http://www.cplusplus.com/reference/fstream/fstream/close/ suggests that is does write all the remaining bytes to file. I have observed (rare) cases where I finish writing a block of 2-3KB to a file, call fs.close() and then try to open it and the open fails. Adding a short delay and/or calling sync seems to cure this.
So I think I have answered my own question, but the std::fstream::close() description confuses me