[squeak-dev] Snapshot and Startup

Eliot Miranda eliot.miranda at gmail.com
Wed Jul 16 18:15:14 UTC 2008


On Wed, Jul 16, 2008 at 10:46 AM, Javier Reyes <jreyes at gmail.com> wrote:

> Hi Eliot,
>
> I have tried wrapping snapshot:andQuit:embedded: in different ways freezing
> the system all the time. The minimal intervention I could figure out from
> your message has been this ( I think I understand now why I never thought
> about writing something like BrouHaHa ;-)
>

:)  You never know how easy it is until you try, try and try again.  I
didn't just write BrouHaHa. I failed to write it a number of times until I
got it right.  One learns from mistakes.  Anyone who says they just get it
right first time either has a selective memory or has never done anything
non-trivial :)


>
>
> ------------
> snapshot:andQuit:embedded:
> ...
> ....
> ...
>     Smalltalk *myProcessStartUpList:* resuming == true.
>     resuming == true ifTrue:[
>         self setPlatformPreferences.
>         self recordStartupStamp].
>     Smalltalk isMorphic ifTrue: [SystemWindow wakeUpTopWindowUponStartup].
>     "Now it's time to raise an error"
>     resuming == nil ifTrue: [self error:'Failed to write image file (disk
> full?)'].
>     ^ resuming! !
>
> ------------
>
> *myProcessStartUpList:* resuming
>     "Send #startUp to each class that needs to run initialization after a
> snapshot."
>
>     self send: #startUp: toClassesNamedIn: (*self lista*) with: resuming.
> ! !
>
> ----------
>
> !SystemDictionary methodsFor: 'snapshot and quit' stamp: 'jr 7/16/2008
> 19:17'!
> *lista*
> (StartUpList select: [:a| (a==#*MyAppSingletonClass)* not]).
> ! !
>
> ----------
> Best,
>
>               Javier
>
>
>
>
>
> On Wed, Jul 16, 2008 at 5:27 PM, Eliot Miranda <eliot.miranda at gmail.com>
> wrote:
>
>>
>>
>> On Wed, Jul 16, 2008 at 8:00 AM, Javier Reyes <jreyes at gmail.com> wrote:
>>
>>> Hello All,
>>>
>>> ¿Is there a way to save the current image without invoking all the
>>> registered startup methods immediately ?
>>>
>>
>> Write your own surround to the snapshot primitive and you can make the
>> startup do whatever you want.  Have a look
>> at SystemDictionary>>snapshot:andQuit:embedded: and what it does after it
>> calls snapshotPrimitive.
>>
>>
>>
>>
>>>
>>>
>>> Best,
>>>              Javier Reyes
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20080716/849b8df1/attachment.htm


More information about the Squeak-dev mailing list