How to safely maintain a status file

Plumo richardbp at gmail.com
Mon Jul 9 01:58:28 EDT 2012


> > and then on startup read from tmp_file if status_file does not exist.
> > But this seems awkward.
>
>         It also violates your requirement -- since the "crash" could take
> place with a partial "temp file".

Can you explain why?
My thinking was if crash took place when writing the temp file this
would not matter because the status file would still exist and be read
from. The temp file would only be renamed when fully written.



More information about the Python-list mailing list