output-buffering

What exactly is file.flush() doing?

What exactly is file.flush() doing? Question: I found this in the Python documentation for File Objects: flush() does not necessarily write the file’s data to disk. Use flush() followed by os.fsync() to ensure this behavior. So my question is: what exactly is Python’s flush doing? I thought that it forces to write data to the …

Total answers: 4