[Cuis-dev] get environment variable value
Gerald Klix
cuis.01 at klix.ch
Mon Dec 9 00:45:53 PST 2024
On 12/9/24 3:02 AM, Vanessa Freudenberg via Cuis-dev wrote:
> Use FFI to call getenv().
>
> Vanessa
>
> On Sun, Dec 8, 2024 at 5:22 PM Mark Volkmann via Cuis-dev <
> cuis-dev at lists.cuis.st> wrote:
>
>> In Cuis Smalltalk how can I get the value of an environment variable that
>> is defined in the process in which the image was started? I
>> thought perhaps this would work, but it doesn't.
>>
>> process := Processor activeProcess.
>> home :- process environmentAt: 'HOME' ifAbsent: [ '' ].
>>
>> --
>> R. Mark Volkmann
>> Object Computing, Inc.
>> --
>> Cuis-dev mailing list
>> Cuis-dev at lists.cuis.st
>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>>
>
Another solution is to load the OSProcess package
and execute this piece of code:
OSProcess thisOSProcess environmentAt: 'HOME'.
HTH,
Gerald
More information about the Cuis-dev
mailing list