Mail Archives: djgpp/1995/02/06/16:08:23
> the run. I suppose that these needed-once-only bits of program could be called
> as child processes; I know how to make Gnu C program X.CC call Gnu C program
> Y.CC; but how can Y.CC write to an array declared within X.CC?
How about calling these programs with popen() instead of spawnXXX()?
If you can arrange for these one-timers to write their output to
standard output, you can then popen("xyzzy.exe", "r") in the main
program and read into your array whatever comes from the stream
which popen() returns. If you care about portability, this is the
way to go.
Alternatively, you could allocate a buffer in low memory by calling
_go32_dpmi_allocate_dos_memory() in the main program, then pass the
address of the buffer to the child process (via command line). The
child can then put its output there with a call to movedata() or
dosmemput().
- Raw text -