On Tue, Oct 28, 2008 at 10:38 AM, Damien Pollet <damien.pollet@gmail.com> wrote:
On Tue, Oct 28, 2008 at 6:08 PM, Eliot Miranda <eliot.miranda@gmail.com> wrote:
> I think the answer for the VM application is no because Mac OS X opens
> applications in /.
> So the VM cannot find the image unless given a full pathname and cannot find
> file unless given a full pathname either since the image won't be in the
> same directory as the image file.

But that's only when you run the application from the Finder or using
/usr/bin/open I think.

If you directly run the binary inside the .app bundle from a shell,
then the unix way applies, no ?

You'd think so, but in my recent experience it isn't reliable.  Sometimes relative paths to the image work, sometimes not.  e.g. ../../foo might be interpreted as ../foo. So I think the only safe assumption is that one needs absolute paths.

> But it is trivial to write a shell script to wrapper the VM that supplies
> the full pathnames, e.g.
> ----8<---squeak---8<---
> #!/bin/sh
> open /Applications/SqueakFoo.app
> /Applications/SqueakFoo.app/Resources/Scripting.image "`pwd`/$1"
> ----8<---squeak---8<---

Heh, I wasn't even aware that open would pass arguments like that.
What Stef and I are doing is
/Applications/Squeak.app/Contents/MacOS/Squeak\ VM\ Opt
$PWD/image.image $PWD/script.st


--
Damien Pollet
type less, do more [ | ] http://people.untyped.org/damien.pollet