[racket] putenv

From: Niklas Larsson (metaniklas at gmail.com)
Date: Tue Oct 23 04:20:27 EDT 2012

From: Niklas Larsson
Sent: 2012-10-23 10:16
To: heraklea at gmx.de
Subject: RE: [racket] putenv
The environment is something that belongs to a process (and its
children). The way to change the system wide defaults on windows (from
a program) is to change the registry keys that hold them. Remember that
those only affect new processes.

Niklas
From: heraklea at gmx.de
Sent: 2012-10-23 09:48
To: racket
Subject: Re: [racket] putenv
Hmm, is there a Racket specific command to change env variables system wide??
The (system "...") command also change it only locally....

Yours,
-------- Original-Nachricht --------
> Datum: Mon, 22 Oct 2012 08:02:36 -0600
> Von: Jay McCarthy <jay.mccarthy at gmail.com>
> An: heraklea at gmx.de
> CC: racket <users at racket-lang.org>
> Betreff: Re: [racket] putenv

> 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
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Posted on the users mailing list.