[enh] safesnap-ls

lex spoon lex at cc.gatech.edu
Sat Jan 20 19:53:16 UTC 2001

Continuing the barrage of tiny 10-20 patches, here's a fix for something
that's been bothering me for a while.  It protects users from losing
their image if the snapshot is interrupted for any reason (eg, hitting
the power button just a little too fast).  -Lex

"Change Set:		safeSnap-ls
Date:			20 January 2001
Author:			Lex Spoon

Update the snapshot routine so that it will first save to a temporary
file, and then move the temporary file over the real image file.  This
way, there is always a complete and valid image on disk.

VM Porter Notes

First, on some platforms, there may not be enough disk space to do
snapshots like this.  If you compile with -DINPLACE_SNAPSHOT=1, then
snapshots will revert to overwriting the image file directly.

Second, two new file access macros are required: sqImageFileDelete and
sqImageFileRename.  By default they are defined as unlink() and
rename(), which should work on most platforms.  On platforms where the
image is stored in an unusual way, however, macros will probably need to
be redefined."!

More information about the Squeak-dev mailing list