title: c++ std::ofstream flush() but not close()
body: <p>I'm on MacOSX.</p>
  
  <p>In the logger part of my application, I'm dumping data to a file.</p>
  
  <p>suppose I have a globally declared <code>std::ofstream outFile("log");</code></p>
  
  <p>and in my logging code I have:</p>
  
  <pre><code>outFile &lt;&lt; "......." ;
  outFile.flush();
  </code></pre>
  
  <p>Now, suppose my code crashes after the flush() happens; Is the stuff written to <code>outFile</code> before the <code>flush()</code> guaranteed to be written to disk (note that I don't call a <code>close()</code>).</p>
  
  <p>Thanks!</p>