[Haskell-cafe] Setting environment variables on Windows

Duncan Coutts duncan.coutts at googlemail.com
Fri Oct 9 13:07:21 EDT 2009

On Fri, 2009-10-09 at 17:37 +0200, Sönke Hahn wrote:
> Hi!
> I need to set an environment variable from Haskell and i would like to do that 
> cross-platform. There is System.Posix.Env.setEnv, which does exactly, what i 
> want on Linux. There is the module System.Environment, which seems to be 
> cross-platform, but it does not contain functions to manipulate the 
> environment (, just to inspect it). At first glance, I didn't find anything 
> relevant in the sub-modules of System.Win32.

Note that often it is enough to set environment variables for the
programs that you invoke, rather than for your own process. If that's
enough then you can do it via the System.Process.createProcess action.


More information about the Haskell-Cafe mailing list