Squeak scripts in UNIX

Bert Freudenberg bert at freudenbergs.de
Fri Feb 16 17:03:23 UTC 2007


On Feb 16, 2007, at 17:20 , Lex Spoon wrote:

> "David T. Lewis" <lewis at mail.msen.com> writes:
>>>> On Unix, "FileDirectory default" gives you the Unix cwd.
>>>
>>> No. It gives you the image directory.
>>
>> There is a "current working directory" introduced into CommandShell,
>> but as Bert says is a concept that does not exist in Squeak, so it
>> had to be added. Furthermore, it works on a per-volume basis in  
>> Windows
>> (C: drive versus D: drive, etc), so it's not clear that this is a
>> very portable concept.
>
> I see.  In the example script header I posted, they would be the same
> directory, but if you reuse an image in a stock location then they
> would be different.
>
> 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.

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 ...

- Bert -





More information about the Squeak-dev mailing list