How do I change the master environment?

Quick and simple answer: you don't.

In OS/2 it is literally impossible for you to change the master environment from one of your programs. To be able to do so would fatally disrupt the programming paradigm that has existed for ages: Your program does not alter the master environment. Your program is the slave, not the master. Therefore, no capability was built into OS/2 to facilitate this.

There is, however, a kludge.

As you know, a .CMD file can alter the master environment. This is the nature of batch files (ok, so I'm a MS-DOG dinosaur and still call them batch files instead of command files or scripts). Therefore, you can place a sequence of commands in the batch file that will take your program's output and alter the environment of your current shell.

That's as close as you are gonna get to the master environment. You can always create your own sort of environment variables, in the form of shared memory or named pipes.


[Back: How do I write an OS/2 device driver?]
[Next: What is the best way to communicate between processes?]