[Cuis-dev] ReferenceStream cannot read Dictionary object written with Squeak (was Re: ReferenceStream restoreFromFile: aFileEntry goes into infinite loop)

H. Hirzel hannes.hirzel at gmail.com
Sat Sep 20 15:06:17 PDT 2025


Hi

I could identify a case which causes problems when working with
ReferenceStreams: Dictionaries written with Squeak.

If I write a dictionary object with a reference stream in Squeak such as
[1]  it gives an error message when reading it in Cuis 7584.
However the same object as written with [1] reads fine in Cuis 7102.

If I do write and read in Cuis 7584 then it works [2].
What does not work in Cuis 7584 is
   ReferenceStream restoreFromFile: ('aDictWithByteArraysFromSq.obj'
asFileEntry).

So something must have happened between version 7102 and 7584 which
prevents dictionary objects written with Squeak from being read in a recent
Cuis version.

Any suggestions on how I can fix this?
The object file as written in [1] is attached.

Hannes

[1]

"Squeak"
dict := Dictionary new.
dict at: 1 put: #[1 2 3 4].
dict at: 2 put: #[5 6 7 8].
dict at: 3 put: #[10 20 30 40].

fileStream := ReferenceStream fileNamed: 'aDictWithByteArraysFromSq.obj'.
objectToSave := dict.
fileStream nextPut: objectToSave.
fileStream close

"-----------------------------------------------"
"Restore in Cuis"
ReferenceStream restoreFromFile: ('aDictWithByteArraysFromSq.obj'
asFileEntry).

"Result
OK in Cuis 7102
NOT OK in Cuis 7584"


"-----------------------------------------------------------------------------------------"
[2]

"Write and read in Cuis 7562"
dict := Dictionary new.
dict at: 1 put: #[1 2 3 4].
dict at: 2 put: #[5 6 7 8].
dict at: 3 put: #[10 20 30 40].

ReferenceStream dumpOnFile: ('dictWithByteArrays.obj' asFileEntry) object:
dict .
ReferenceStream restoreFromFile: ('dictWithByteArrays.obj' asFileEntry).
 "OK"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250921/6c5bc16c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: aDictWithByteArraysFromSq.obj
Type: application/octet-stream
Size: 97 bytes
Desc: not available
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20250921/6c5bc16c/attachment.obj>


More information about the Cuis-dev mailing list