Squeak scripts in UNIX
Bert Freudenberg
bert at freudenbergs.de
Wed Feb 14 20:51:17 UTC 2007
On Feb 14, 2007, at 21:12 , Lex Spoon wrote:
> Bert Freudenberg <bert at freudenbergs.de> writes:
>> The harder part is that there is no concept of a current working
>> directory in Squeak. To find the script, you need to convert a
>> relative path to the absolute one using cwd. This can either be done
>> in the shell script, or one could abuse the SecurityPlugin which
>> listens to environment variables ... or extend the VM ... or use
>> OSProcess ...
>
> On Unix, "FileDirectory default" gives you the Unix cwd.
No. It gives you the image directory.
> That said, that's very interesting that using the absolute path works
> already. Maybe the easiest thing, then, is to come up with some
> shell-script magic to rewrite $0 into an absolute path. Do any Unix
> hackers here know how to do that?
I was using this:
case "$2" in
/*) DOCUMENT="$2"
;;
*) DOCUMENT="$PWD/$2"
;;
esac
(from http://etoys.laptop.org/src/etoys.in)
- Bert -
More information about the Squeak-dev
mailing list
|