[Haskell-cafe] Setting environment variables on Windows

Peter Verswyvelen bugfact at gmail.com
Fri Oct 9 13:19:30 EDT 2009

Mmm, that seems like a shortcoming.

Well, you could just wrap the C functions yourself, like this (two
possibilities, no error checking yet, quick hack):

Note that using SetEnvironmentVariable does not seem to be compatible with
getEnv, but calling _putenv does work.

So I guess someone should add this setEnv wrapper to the System.Environment
module? Ticket?

On Fri, Oct 9, 2009 at 5:37 PM, Sönke Hahn <shahn at cs.tu-berlin.de> wrote:
> Hi!
> I need to set an environment variable from Haskell and i would like to do
> cross-platform. There is System.Posix.Env.setEnv, which does exactly, what
> 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
> relevant in the sub-modules of System.Win32.
> Is this just not implemented? How could i implement it myself?
> Grateful for any comment,
> Sönke
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20091009/7a4699b2/attachment.html

More information about the Haskell-Cafe mailing list