[darcs-users] [Haskell-cafe] Help converting Perl to Haskell

Duncan Coutts duncan.coutts at worc.ox.ac.uk
Wed Oct 22 04:33:28 UTC 2008


On Tue, 2008-10-21 at 20:33 -0700, Jason Dagit wrote:

> Correct me if I'm wrong, but if I want to make this work on windows I
> can't use System.Posix, right?  If so, what is the portable way to set
> environment variables?  I see[1] that getEnv exists in
> System.Environment, but setEnv is in System.Posix.Env.  I looked in
> System.Win32 and I didn't see anything that looked like it would
> manipulate environment variables.  Will I have to use
> System.Process.runProcess on Win32?  I'd like this to work on ghc 6.6
> and System.Process looks new?

Right. Typically you do not need to change the env vars for your own
process, just to pass new ones to new processes and
System.Process.runProcess lets you specify a new set of environment
vars.

As you can check, System.Process.runProcess has been around since ghc
6.6 (and before):

http://www.haskell.org/ghc/docs/6.6/html/libraries/base/System-Process.html#v%3ArunProcess

Duncan



More information about the darcs-users mailing list