Squeak scripts in UNIX

Lex Spoon lex at lexspoon.org
Fri Feb 16 23:03:56 UTC 2007


Bert Freudenberg <bert at freudenbergs.de> writes:
> On Feb 16, 2007, at 17:20 , Lex Spoon wrote:
> > Why is the default directory set to the image's directory, anyway?
> > That seems like zero bits of information: you can already compute it
> > from the image's filename.  Additionally, isn't the most sensible
> > "default directory" the same as the "default directory" (cwd) of the
> > calling process?
> 
> No. When you launch by double-clicking an image, the CWD can be
> anything.

True.  To clarify, the proposal is to use the calling process's
default directory if there is one, e.g. if you double click.  If the
calling process has nothing better to supply, then of course it can
specify the image's directory.


> Besides, there are quite a few places in the image that assume image
> dir equals default dir. IIRC image saving goes nuts as well as source
> condensing etc. if the two differ.
> 
> But even if we wanted to change this, you would need to find a way to
> pass the CWD to the image. Or change the in-image code to pass
> relative paths down into the primitives - bypassing the default file
> dir completely ...


Okay, it looks hard to change given all the legacy.  It would be nice,
though, if the VM could pass in (a) the default directory, and (b) a
directory with the sources files.  These are useful concepts on just
about any platform imaginable, and so should not need relegating to an
optional plugin.

Given the status quo, though, I guess a Unixy script needs to do
something else.  There are options.  They can use OSProcess (which
likely they want to use, anyway!), or they could have the shell script
code pass in $PWD as an argument to the Squeak code.


-Lex





More information about the Squeak-dev mailing list