A simple getenv primitive

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

A simple getenv primitive

Damien Cassou
 
Hi,

I can't find any getenv primitive that would allow me to access
environment an variable value from its name. This could be really
helpful to get the HOME directory for example. Does one such primitive
exist? If not, why? It looks trivial to implement for linux, and it is
potentially also easy on Windows and Mac OS. I'm willing to try if
necessary.

Thank you

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Lambdas are relegated to relative obscurity until Java makes them
popular by not having them." James Iry
Reply | Threaded
Open this post in threaded view
|

Re: A simple getenv primitive

Bert Freudenberg
 
On 03.05.2012, at 10:24, Damien Cassou wrote:

> Hi,
>
> I can't find any getenv primitive that would allow me to access
> environment an variable value from its name. This could be really
> helpful to get the HOME directory for example. Does one such primitive
> exist? If not, why? It looks trivial to implement for linux, and it is
> potentially also easy on Windows and Mac OS. I'm willing to try if
> necessary.
>
> Thank you

OSProcess thisOSProcess environmentAt: 'HOME'

=> '/Users/bert'

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: A simple getenv primitive

Damien Cassou
 
On Thu, May 3, 2012 at 11:26 AM, Bert Freudenberg <[hidden email]> wrote:
> OSProcess thisOSProcess environmentAt: 'HOME'
>
> => '/Users/bert'

Thank you Bert. I never used OSProcess before it has never worked for
me. Looks like it works now.

Thanks

--
Damien Cassou
http://damiencassou.seasidehosting.st

"Lambdas are relegated to relative obscurity until Java makes them
popular by not having them." James Iry