On Wed, Oct 6, 2010 at 10:58 AM, K. K. Subramaniam <kksubbu.ml@gmail.com> wrote:
 
On Wednesday 06 Oct 2010 10:16:35 pm Bert Freudenberg wrote:
> If Cog cannot do this then we need to figure out a way to cleanly install
> interpreter and Cog VMs side-by-side.
This should not be a problem for Unix ports. The squeak.sh can be patched to
detect VM image format and then launch the right VM for it. The magic file is
attached. e.g.

$ file -m squeak.magic *.image
Squeak3.9-7067.image:          Squeak Image Classic
Squeak4.2-10548-alpha.image:   Squeak Image Standard

Subbu

BTW, the following might be useful too, which dumps much of the image header (at least on linux & Mac OS X): 
#!/bin/sh
if [ \( $# -eq 0 \) -o \( "$1" = "--help" \) -o \( "$1" = "-?" \) ]; then
    echo "usage: $0 imagefile [imagefile...]"
    exit 0
fi
if [ $# -eq 1 ]; then
    hexdump -n 44 -e \
    '"version  : %u\n"
     "header sz: %u\n"
     "data size: %u\n"
     "base addr: 0x%08x\n"
     "soa oop  : 0x%08x\n"
     "last hash: 0x%08x\n"
     1/2
     "window  y: %d" 1/2 " x: %d" 1/4 " flags (full screen,float order...): 0x%x\n"
     "extra mem: %u\n"
     1/2
     "n stk pg : %u\n"
     1/2
     "code kb  : %u\n"
     "eden byt : %u\n"' "$1"
    exit 0
fi
for f in "$@"; do
    echo
    hexdump -n 44 -e \
    "\"$f: version  : %u\n\"
     \"$f: header sz: %u\n\"
     \"$f: data size: %u\n\"
     \"$f: base addr: 0x%08x\n\"
     \"$f: soa oop  : 0x%08x\n\"
     \"$f: last hash: 0x%08x\n\"
     1/2
     \"$f: window  y: %d\" 1/2 \" x: %d\" 1/4 \" flags (full screen,float order...): 0x%x\n\"
     \"$f: extra mem: %u\n\"
     1/2
     \"$f: n stk pg : %u\n\"
     1/2
     \"$f: code kb  : %u\n\"
     \"$f: eden byt : %u\n\"" "$f"
done