[Newbies] saving image automatically

David Shaffer cdshaffer at acm.org
Mon Apr 30 19:17:44 UTC 2007

Norbert Hartl wrote:
> Hi,
> I'm trying to save an image under a different name. I
> have a image I'm working with (e.g. VNC enabled) and I
> like to create a derived image under a different name.
> I use
> MySetup>>deploy
> 	RFBServer doStopServer.
> 	SmalltalkImage current closeSourceFiles.
> 	SmalltalkImage current saveChangesInFileNamed: 'base-deploy.changes'.
> 	SmalltalkImage current saveImageInFileNamed: 'base-deploy.image'.
> 	SmalltalkImage current snapshot: false andQuit: true

This is going to sound stupid but my solution to this is to save twice.  
I do exactly what you describe in several of my image building scripts.  
Basically the sequence:

MCFileBasedRepository flushAllCaches.
RFBServer stop.
SmalltalkImage current  saveAs: 'something'
SmalltalkImage current snapshot: true andQuit: true

The reason that I do this is that snapshot:andQuit: has logic to make 
sure that when an image is restarted it doesn't quit.  You could 
probably duplicate that logic but I found this solution to be more 
expedient.  I'm eager to hear a better way :-) :-)


More information about the Beginners mailing list