purging file buffers - to make new data be written to file

Fernando Pérez fperez528 at yahoo.com
Sun Apr 7 20:02:11 EDT 2002


> On Linux.  The program is to save a memo in a slightly organised format,
> but I find the file is not written until Python exits.

You need to call your_file_object.close() for the buffer to be written to disk 
(technically, that triggers a system write call, which is itself delayed by 
filesystem write caching. But that's a minor point).

Cheers,

f. 




More information about the Python-list mailing list