Do I need to os.fsync() before f.close()?
Do I need to os.fsync() before f.close()? Question: "what exactly the python’s file.flush() is doing?" says you should first f.flush() and then os.fsync(f.fileno()) to make sure the data are written to the disk. Furthermore, "does close() imply flush() in Python?" claims that f.close() implies a flush(). Now, the question is: should I do os.fsync(f.fileno()) f.close() …