Mmm, that seems like a shortcoming.<br><br>Well, you could just wrap the C functions yourself, like this (two possibilities, no error checking yet, quick hack):<div><a href="http://hpaste.org/fastcgi/hpaste.fcgi/view?id=10565#a10565">http://hpaste.org/fastcgi/hpaste.fcgi/view?id=10565#a10565</a></div>
<div><br></div><div>Note that using SetEnvironmentVariable does not seem to be compatible with getEnv, but calling _putenv does work.</div><div><br></div><div>So I guess someone should add this setEnv wrapper to the System.Environment module? Ticket?</div>
<div><br></div><div><br>On Fri, Oct 9, 2009 at 5:37 PM, Sönke Hahn <<a href="mailto:shahn@cs.tu-berlin.de">shahn@cs.tu-berlin.de</a>> wrote:<br>> Hi!<br>><br>> I need to set an environment variable from Haskell and i would like to do that<br>
> cross-platform. There is System.Posix.Env.setEnv, which does exactly, what i<br>> want on Linux. There is the module System.Environment, which seems to be<br>> cross-platform, but it does not contain functions to manipulate the<br>
> environment (, just to inspect it). At first glance, I didn't find anything<br>> relevant in the sub-modules of System.Win32.<br>><br>> Is this just not implemented? How could i implement it myself?<br>><br>
> Grateful for any comment,<br>><br>> Sönke<br>> _______________________________________________<br>> Haskell-Cafe mailing list<br>> <a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
> <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>><br><br></div>