code: def file_writelines_flush_sync(path, lines):
      
      fp = open(path, 'w')
      try:
          fp.writelines(lines)
          flush_sync_file_object(fp)
      finally:
          fp.close()
docs: Fill file at @path with @lines then flush all buffers
      (Python and system buffers)