This is kinda related to monotone, but really I'm asking here because,
of the mailing lists I'm on, it seems most likely that someone who
knows the answer will be here.

As far as I can tell, this is the most efficient way in standard C++
to write the entire contents of a string to a file:

  std::copy(data.begin(), data.end(), ostreambuf_iterator<char>(&fout));

('data' is the string, 'fout' is a std::filebuf opened on the file.)
The problem is I have no idea how to detect write errors.  Can anyone
tell me how to do that?  Also whether there's a less, er, abstruse way
to do this?

thanks in advance
zw


_______________________________________________
Monotone-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/monotone-devel

Reply via email to