[Seaside] Serializing collection of objects to file

Avi Bryant avi.bryant at gmail.com
Thu Oct 27 16:09:35 UTC 2005


On Oct 27, 2005, at 9:04 AM, Chad Nantais wrote:

> I use a dictionary in my image to store my objects.  What's the best
> way to serialize this dictionary to a file so that I can file it in to
> a different image?

Here's one way:

"write"
(SmartRefStream on: (FileStream forceNewFileNamed: 'mydict.obj'))  
nextPut: dict; close.

"read"
dict2 := (FileStream fileNamed: 'mydict.obj') fileInObjectAndCode

Cheers,
Avi


More information about the Seaside mailing list