Hi,
In Python, and in general - does a close()
operation on a file object imply a flush()
operation?
Adam
Hi,
In Python, and in general - does a close()
operation on a file object imply a flush()
operation?
Adam
Yes. It uses the underlying close()
function which does that for you. Source here.
NB: close()
and flush()
won't ensure that the data is actually secure on the disk. It just ensures that the OS has the data == that it isn't buffered inside the process.
You can try sync or fsync to get the data written to the disk.