def fsync(fd):
 if hasattr(fcntl, 'F_FULLSYNC'):
  try:
   fcntl.fcntl(fd, fcntl.F_FULLSYNC)
  except IOError as e:
   raise OSError(e.errno, ('Unable to F_FULLSYNC(%s)' % fd))
 else:
  os.fsync(fd)

def fsync ( fd ) : if hasattr ( fcntl , 'F_FULLSYNC' ) : try : fcntl . fcntl ( fd , fcntl . F_FULLSYNC ) except IOError as e : raise OSError ( e . errno , ( 'Unable to F_FULLSYNC(%s)' % fd ) ) else : os . fsync ( fd )
sync modified file data and metadata to disk .