Use a temp file to save checkpoints
Status: Alpha
Brought to you by:
wrdieter
Save checkpoints to a temporary file then move that
file to the real checkpoint file name, or set a flag in
the checkpoint file after everything else has been
correctly written to the file. That way it will be
clear if the process finished writing the checkpoint if
the process should fail during checkpointing.