[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] How to access environment variables ?
From: |
Paolo Bonzini |
Subject: |
Re: [Help-smalltalk] How to access environment variables ? |
Date: |
Tue, 10 Feb 2009 15:11:08 +0100 |
User-agent: |
Thunderbird 2.0.0.19 (Macintosh/20081209) |
> There are extra shell variables showing up like PATH, BASH, TERM, etc.
> which do not show up in a CGI environment using any other language that
> I've used to write a similar CGI program (Perl, PHP, Lisp, Scheme, C,
> Tcl). All of them print out the same variables as the output of the
> Perl script. What we seem to be doing in Smalltalk is forking/execing
> a shell and and then getting the environment variables so that we end up
> with variables from a hybrid environment of CGI and shell.
Yes, you're right that's suboptimal.
What is really needed is a package covering POSIX stuff, from
environment to process creation, in a nice object-oriented way. Ideally
you could do something like
redirections := SpawnParameters new
stdin: (FileStream open: '/dev/null' mode: FileStream write);
stdout: (FileStream newPipe: FileStream write);
stderr: FileStream stderr;
workingDirectory: '/'.
process := redirections spawn: 'ls -lR'.
s := [ process stdout readSide contents ] fork.
process wait
Paolo
- Re: [Help-smalltalk] How to access environment variables ?, Mehul N. Sanghvi, 2009/02/09
- Re: [Help-smalltalk] How to access environment variables ?, Stephen, 2009/02/10
- Re: [Help-smalltalk] How to access environment variables ?, Mehul N. Sanghvi, 2009/02/10
- Re: [Help-smalltalk] How to access environment variables ?,
Paolo Bonzini <=
- Re: [Help-smalltalk] How to access environment variables ?, Krishna, 2009/02/10
- Re: [Help-smalltalk] How to access environment variables ?, Paolo Bonzini, 2009/02/10
- Re: [Help-smalltalk] How to access environment variables ?, Krishna, 2009/02/10
- Re: [Help-smalltalk] How to access environment variables ?, Krishna, 2009/02/10
- Re: [Help-smalltalk] How to access environment variables ?, Mehul N. Sanghvi, 2009/02/10
- Re: [Help-smalltalk] How to access environment variables ?, Paolo Bonzini, 2009/02/10
- Re: [Help-smalltalk] How to access environment variables ?, Mehul N. Sanghvi, 2009/02/10