Double-clickable app proposal
Maloney
johnm at wdi.disney.com
Tue Feb 17 00:27:36 UTC 1998
At 4:49 PM -0500 2/2/98, Chris Reuter wrote:
>> Folks -
>>
>> What if a Squeak VM file could recognize if an image file were simply
>> appended to it, and do the right thing? Then it should take no more
>> to make a double-clickable app than to do a save followed by a file
>> copy.
>>
>> OS gurus: Can this be done simply on the Mac PPC, 68K, Windows,
>>Unix, OS/2, etc?
>
>Well, the easy way to do this under Unix would be to prepend something
>like
>
>#!/usr/local/bin/Squeak
>
>onto the beginning of the image and make Squeak ignore it. That has
>the effect of making Unix treat the image file as a script with Squeak
>as the interpreter. Of course, the actual prefix string should be
>settable from Squeak and the interpreter smart enough skip an
>arbitrary number of bytes so that an installation script, say, could
>put the actual path to Squeak in there without needing to run Squeak.
>
>As for appending the image to an executable, the COFF file format is,
>according to my more-knowledgable co-worker, not sufficiently
>standardized to allow this to work portably. (I'm not sure about ELF,
>though.) What he proposes is storing the image in an object (.o) file
>and linking it to the interpreter. This would require the use of the
>system linker. It's probably preferable to the #! approach since it
>guarantees that the image and interpreter are compatible.
There is already provision for handling this in the Squeak image
file reader. You just need to use "cat" or a similar tool to prepend
the string "#!/usr/local/bin/Squeak" (or whatever) padded to exactly
512 bytes. The image reading code will look for the start of the image
512 bytes into the file if it doesn't recognize an image header
at the beginning of the file.
Of course, this isn't quite the same as having the image and executable
packaged into a single file, but in some ways it is better since it
allows the executable to be shared.
-- John
More information about the Squeak-dev
mailing list
|