[racket] putenv

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Mon Oct 22 10:02:36 EDT 2012

How are you checking "in the system"?

putenv does not make a global change to your system settings, instead
it changes the environment locally. For example, on Unix (it would
work the same on Windows, but I don't know a lot about the Windows
shell),

[outer] $ FOO=1
[outer] $ echo $FOO
1
[outer] $ racket
[racket] > (putenv "FOO" "2")
#t
[racket] > (getenv "FOO")
"2"
[racket] > (system "/bin/sh")
[inner] $ echo $FOO
2
[inner] $ exit
> (exit 0)
[outer] $ echo $FOO
1

The only real use of putenv is with system, when you want the Racket
program to run another program.

Jay

On Mon, Oct 22, 2012 at 7:38 AM,  <heraklea at gmx.de> wrote:
> Hello friends,
>
> I try to change my env variables in windows 7. getenv works fine, but when I change a specific env variable it returns #t but in the system there are no changes...
>
>
> Yours,
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93

Posted on the users mailing list.