[Coco] OS-9 environment variables?

Gene Heskett gene.heskett at verizon.net
Wed Apr 15 20:31:41 EDT 2009


On Wednesday 15 April 2009, Allen Huffman wrote:
>On Apr 15, 2009, at 11:39 AM, Roger Taylor wrote:
>> Is the data guaranteed to be there after hitting Reset?
>
>No. It would be like environment variables on DOS, etc. where they are
>just named values you can set and read between programs.
>
>However, due to implementing it in a DATA MODULE on OS-9, there would
>be the capability to write them to disk, and restore on the next boot.
>
>RESET causes the system to reload, yes?
>
>GENE:
>> Tell me, is this going to be easier that having a file on disk (or
>> in myram,
>> copied there by the startup script) along with a cron job to check &
>> see if
>
>I was not planning any such thing. The user would be responsible for
>saving data if it was important to them. What operating systems
>provide environment variables that are maintained between reboots? I
>have not worked with any that did that, so I didn't even know that was
>an option.

None that save a changed value over a reset/reboot without manual intervention 
that I'm aware of, Allen.  Linux sets all that stuff in /etc/profile, and in 
the individual users ~/.bashrc, where the tilde is short hand for /home/user.  

I doubt there are very many linux users who haven't edited the ~/.bashrc for 
one reason or another.

>TIM:
>> Don't most OS's keep the environment variables in a file?
>> like .profoile, .csh, .login .logout etc?
>
>Not that I know of. THose are read-only configuration files, read at
>startup (like autoexec.bat) or shell start or login. Different
>creatures.
>
>WILLARD:
>> getenv() and setenv() in the cgfx library read/write "environment
>> variables" from /dd/sys/env.file
>
>Willard shoots and scores! I did not know CGFX had those calls, though
>during my CoCO days, I have never heard of getenv() and setenv().
>INTERESTING!
>
>Is that the stock Tandy version of CGFX, or the third party one?

I'd have to go check my tandy docs to be sure, but ISTR seeing it in there.
However the 3rd party CGFX is the preferred animal, if for no other reason 
than I believe its noticeably faster. 

-- 
Cheers, Gene
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Dear Lord: Please make my words sweet and tender, for tomorrow I may
have to eat them.




More information about the Coco mailing list