title: Disk gets full during file write. How can I get notified about this?
body: <p>I have a quite big object to serialize to disk, like this:</p>
  
  <pre><code>if (!EngineFile.empty())
  {
      std::ofstream OutEngineStream(EngineFile);
      if (!OutEngineStream)
      {
          std::cerr &lt;&lt; "Failed to write to file \"" &lt;&lt; EngineFile &lt;&lt; "\"! Aborting ..." &lt;&lt; std::endl;
          return -1;
      }
      engine-&gt;serialize(OutEngineStream);
      OutEngineStream.close();
  
      std::cout &lt;&lt; "\"" &lt;&lt; EngineFile &lt;&lt; "\" successfully wrote to disk." &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>The problem is, somtimes <code>serialize</code> requires larger disk space than available. e.g. there is only 30M storage available but <code>serialize</code> requires 200M. In this case I can normally <code>open</code> the stream. During <code>serialize</code> everything goes well, and <code>close</code> returns nothing. The program runs well, but there is only a 30M file on the disk.</p>
  
  <p>How can I get to know about this case?</p>