yes, please. I stumbled across the code this week and the last few statements don't make sense on a number of platforms, because they presume a command-line:
checkImageVersionFrom: f startingAt: imageOffset
"Read and verify the image file version number and return true if the the given image file needs to be byte-swapped. As a side effect, position the file stream just after the version number of the image header. This code prints a warning and does a hard-exit if it cannot find a valid version number."
"This code is based on C code by Ian Piumarta."
| version firstVersion |
<var: #f type: 'sqImageFile '>
<var: #imageOffset type: 'squeakFileOffsetType '>
"check the version number"
self sqImageFile: f Seek: imageOffset.
version := firstVersion := self getLongFromFile: f swap: false.
(self readableFormat: version) ifTrue: [^ false].
"try with bytes reversed"
self sqImageFile: f Seek: imageOffset.
version := self getLongFromFile: f swap: true.
(self readableFormat: version) ifTrue: [^ true].
"Note: The following is only meaningful if not reading an embedded image"
imageOffset = 0 ifTrue:[
"try skipping the first 512 bytes (prepended by certain Mac file transfer utilities)"
self sqImageFile: f Seek: 512.
version := self getLongFromFile: f swap: false.
(self readableFormat: version) ifTrue: [^ false].
"try skipping the first 512 bytes with bytes reversed"
self sqImageFile: f Seek: 512.
version := self getLongFromFile: f swap: true.
(self readableFormat: version) ifTrue: [^ true]].
"hard failure; abort"
self print: 'This interpreter (vers. '.
self printNum: self imageFormatVersion.
self print: ') cannot read image file (vers. '.
self printNum: firstVersion.
self print: ').'.
self cr.
self print: 'Press CR to quit...'.
self getchar.
self ioExit.
self ioReportImageFormat: firstVersion incompatibleWith: self imageFormatVersion andThenExit: nil
and let the platform deal with this as it chooses.