Image Persistency Problems

For the Pharo 3.1 Pier Addon images, there has repeatedly been an issue with a failure of the scheduled image saves, the error appears as a walkback for the image file not existing:

FileHandle			streamError
FileHandle			readStream
FileReference			readStreamOn:
FileReference			readStream
FileReference			readOnlyFileNamed:
FileReference			copyFileWithoutOverwriteConfirmationNamed:toFileNamed:
PRImagePersistency		saveImageAndBackupAs:

To make the problem more interesting, the debugger or browsers show that no method has any source. This second problem can be bypassed with:

SmalltalkImage current openSourceFiles

Looking into PRImagePersistency>>saveImageAndBackupAs:, it sends several legacy messages - #copyFileWithoutOverwriteConfirmationNamed:toFileNamed:. Taking a tip from the deep Pharo book, this can be replaced by deleting the image backup changes and image, and then copying to these names.

A better solution seems to be to use: image backupTo: short_name (An alternative would be to use #backupImageInFileNamed:, however that would not save the changes so it may not be a useful way to revert back). This is the code in Pier-Pharo-Persistency-JohnCBorden.25.mcz in http://www.smalltalkhub.com/#!/~Pier/Pier3. Unfortunately after saving, the backup method causes an issue with the changes file, which also stops the webserver from working. Version 26 reverts back to copying the image and changes files.

Posted by John Borden at 15 September 2014, 2:10 pm link