[Python-Dev] wait time [was: Ext4 data loss]

Jim Jewett jimjjewett at gmail.com
Thu Mar 12 20:47:38 CET 2009


It is starting to look as though flush (and close?) should take an
optional wait parameter, to indicate how much re-assurance you're
willing to wait for.

It also looks like we can't know enough to predict all sensible
symbolic constants -- so instead use a floating point numeric value.

f.flush(wait=0)  ==> current behavior
f.flush(wait=1)  ==> Do everything you can.  On a Mac, this would
apparently mean (everything up to and including) fcntl(fd, F_FULLSYNC)

f.flush(wait=0.5) ==> somewhere in between, depending on the operating
system and file system and disk drive and other stuff the devoloper
won't know in advance.

The exact interpretation of intermediate values might depend on the
installation or even change over time; the only invariant would be
that higher values are at least as safe, and lower values are at least
as fast.

-jJ


More information about the Python-Dev mailing list