confusion about opening files

Greg Ewing see_reply_address at something.invalid
Tue Sep 24 23:19:30 EDT 2002


> Flush, and unbuffered files, ASK the OS to please, please write the
> data out -- but not all OS's comply.


Even on Unix, I'm not sure that flush() ensures that
the data is physically written to the disk. The Linux
man page for fflush(3) says:

NOTES
        Note  that fflush only flushes the user space buffers pro­
        vided by the C library.  To ensure that the data is physi­
        cally  stored  on  disk the kernel buffers must be flushed
        too, e.g. with sync(2) or fsync(2).

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg




More information about the Python-list mailing list