Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

How to set env. var from C program (Developers)

posted by RayeR Homepage, CZ, 15.01.2013, 10:31
(edited by RayeR on 15.01.2013, 13:24)

> In such way you change only your local copy of environment for your
> program.
> To make the changes persistent you must change the master environment
> (look for "DOS master environment" in google)

Hm, that I feared about - you mean there's no standard C function to do this. As I try to keep portability over dos/win/linux I don't want implement any dirty hack like direct rewriting memory.
I was asked from user of CPUID that I implement a feature that put CPU name string into env. var. I hoped it would be easy task because I remember there are getenv/putenv manipulation funcs in stdlib but it's useless :-(

EDIT: I asked colleagues and there's no way. User would need to use grep/awk to filter out the desired text and then use it for SET.

---
DOS gives me freedom to unlimited HW access.

 

Complete thread:

Back to the forum
Board view  Mix view
22762 Postings in 2122 Threads, 402 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum