using #storeOn:

Scott Wallace Scott.Wallace at disney.com
Wed Dec 8 16:27:07 UTC 1999


Jason,

The rule of thumb is that whatever you store out by sending #storeOn: 
to an object, you ought to be able to read back in by sending 
#readFrom: to its class.   Look at implementors of #readFrom:, 
starting with Object class's implementation.

If you don't need the file to be human-readable, consider instead 
using a ReferenceStream.  This makes things very easy.  Look, for 
example, at StandardScriptingSystem methods #saveFormsToFileNamed: 
and #readFormsFromFileNamed:.  These serve to save a dictionary of 
forms to a file on one system and reconstitute it on another one.

   -- Scott

At 7:39 AM -0500 12/8/99, Jason McVay wrote:
>i used #storeOn: to file out a Dictionary. how do i file it back in,
>restoring the Dictionary? (i've done the simple #entireContentsOfFile, but
>of course all i got was a String).
>
>thanks
>jason





More information about the Squeak-dev mailing list