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 Wed, Mar 17, 2010 at 04:11:16PM -0700, Pavel Sanda wrote:
> > The new C++ standard acknowledges the existence of POSIX and the
> > threading components provide implementation-defined ways to access
> > non-portable native handles, it's a shame we didn't revisit iostreams
> > to do something similar. I don't have a good answer, and it's too late
> > to deal with it for C++1x.
>
> Isn't possible that C++ standard could be interpreted in the way that
> you are free to use fsync() inside close() implementation?
Are you suggesting putting an fsync() in every close()? That
would be hugely expensive.
It seems that there should be a Posix extension to C++ that would
provide a way to get the Posix file descriptor corresponding to
an fstream.