title: What exactly is file.flush() doing?
body: <p>I found this in the Python <a href="https://docs.python.org/2/library/stdtypes.html#file.flush" rel="noreferrer">documentation for File Objects</a>:</p>
  <blockquote>
  <p><code>flush()</code> does not necessarily write the file’s data to disk. Use <code>flush()</code> followed by <a href="https://docs.python.org/2/library/os.html#os.fsync" rel="noreferrer"><code>os.fsync()</code></a> to ensure this behavior.</p>
  </blockquote>
  <p>So my question is: what exactly is Python's <code>flush</code> doing? I thought that it forces to write data to the disk, but now I see that it doesn't. Why?</p>