fraillt/bitsery

Serializing to files fails silently if there's not enough space on the disk

VelocityRa opened this issue · 0 comments

The following:

_ostream->rdbuf()->sputn(data, static_cast<std::streamsize>(size));

should error out (I guess error(ReaderError::DataOverflow);?) if the sputn call returns something other than size. Same for the other sputn calls.

This error is also not feasible to detect outside of the library. ofstream::good() doesn't work, it returns true even if sputn failed to complete fully.