knowing when file is flushed to disk
Neil Hodgson
nyamatongwe+thunder at gmail.com
Wed Aug 9 20:20:47 EDT 2006
John Pote:
> Is there some way from my Python script to know when the data is actually on
> the disk. BTW server OS is Linux. Presumably calling flush() and close() on
> the output file will initiate the disk write, but do they wait for the
> actual disk write or immediately return leaving the OS to do the write when
> it sees fit?
No, commonly they will schedule these operations and return quickly.
You can try os.fsync but there are no real guarantees about what that
does either. There's an amusing message from Tim Peters about this:
http://mail.zope.org/pipermail/zodb-dev/2004-July/007689.html
Neil
More information about the Python-list
mailing list