title: Force write of a file to disk
body: <p>I'm currently implementing a ping/pong buffering scheme to safely write a file to disk. I'm using C++/Boost on a Linux/CentOS machine. Now I'm facing the problem to force the actual write of the file to disk. Is it possible to do so irrespective of all the caching policies of the filesystem (ext3/ext4) / SO custom rules / RAID controller / harddisk controller ?</p>
  
  <p>Is it best to use plain fread()/fwrite(), c++ ostream or boost filesystem?</p>
  
  <p>I've heard that simply flushing out the file (fflush()) doesn't guarantee the actual write  </p>