def _sync_flush(f):
 f.flush()
 if hasattr(os, 'fsync'):
  os.fsync(f.fileno())

def _sync_flush ( f ) : f . flush ( ) if hasattr ( os , 'fsync' ) : os . fsync ( f . fileno ( ) )
ensure changes to file f are physically on disk .