This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: ofstream, fsync and data loss bugs
On 03/18/2010 12:49 AM, Pavel Sanda wrote:
>> Are you suggesting putting an fsync() in every close()?
>>
> I'm rather mapping out the terrain for something like
>
> ofstream ofs(filename, ios::out|ios::trunc|ios::fsync);
>
Is there *any* existing practice about this issue? Before attempting
something, even as a GCC extension - which would be unportable anyway
until standardized, that is no better than ext/stdio_filebuf - we should
investigate whether other implementations are *somehow* trying to do
something about it.
Paolo.