title: I/O concept flush vs sync
body: <p>I have come across these two terms and my understanding of them seem to overlap with each other. Flush is used with buffers and sync is used to talk about persisting changes of file to disk.</p>
  
  <p>In C, fflush(stdin) makes sure that the buffer is cleared. And fsync to persist changes file to disk.</p>
  
  <p>If these concepts are not universally defined, would prefer a linux, java explanation.</p>
  
  <p>I found a related post, but ir doesn't really answer my question. <a href="https://stackoverflow.com/questions/730521/really-force-file-sync-flush-in-java">Really force file sync/flush in Java</a></p>