Can a later vm make an image an earlier vm can't open?
David T. Lewis
lewis at mail.msen.com
Sat Feb 16 23:38:43 UTC 2002
On Sat, Feb 16, 2002 at 01:22:11PM -0800, Tim Rowledge wrote:
>
> If you have an editor capable of opening the image and editing it
> safely, you could try doing exactly what I did when I found the problem
> ; remove the first 512 bytes.
Thanks, I had just encountered this very problem. And it the absence of
a suitable text editor, a CSOTD will suffice:
<CSOTD>
| newName new old fd |
newName _ 'patchedImage'.
fd _ FileDirectory default.
(fd isAFileNamed: newName, 'image')
ifTrue: [self notify: newName, 'image exists']
ifFalse:
[new _ (StandardFileStream newFileNamed: newName, '.image') binary.
old _ (StandardFileStream oldFileNamed: Smalltalk imageName) binary.
old next: 512. "Skip header"
fd copyFile: old toFile: new.
fd copyFileNamed: Smalltalk changesName toFileNamed: newName, '.changes'.
new close.
old close]
</CSOTD>
More information about the Squeak-dev
mailing list
|