Force write of file with filedescriptor fd to disk. On Unix, this
calls the native fsync() function; on Windows, the MS _commit()
If you’re starting with a Python file object f, first do
f.flush(), and then do os.fsync(f.fileno()), to ensure that all
internal buffers associated with f are written to disk.
Availability: Unix, and Windows starting in 2.2.3.