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 j_hoff, 15.01.2013, 23:57

> 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.

Without a "dirty hack" you wont be able to do it. But if you don't fear "undocumented features" then it can be done!

> Hm, it seems I have to use such batch files because it seems that I cannon feed SET with redirector <
> SET VAR=<program.exe
> doesn't work, it has to be file. And under dos I can use only real file on disk...

That's true and that's exactly why the utility PIPESET exists. Get the DOSUTILS package e.g. from here: http://www.bttr-software.de/products/jhoffmann/ and see whether it does what you need. You could do it with such a command line:

program.exe | PIPESET VAR

Or look into the sources, which are also included in the package, to see how it can be done in C.

 

Complete thread:

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