Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!asuvax!ukma!usenet.ins.cwru.edu!gatech!uflorida!reef.cis.ufl.edu!jdb From: jdb@reef.cis.ufl.edu (Brian K. W. Hook) Newsgroups: comp.os.msdos.programmer Subject: Re: Spawning processes in DOS Message-ID: <27813@uflorida.cis.ufl.EDU> Date: 4 Apr 91 14:51:43 GMT References: <1991Apr3.133226.22304@ibmpa.awdpa.ibm.com> <1374@bragi.ctron.com> Sender: news@uflorida.cis.ufl.EDU Organization: UF CIS Dept. Lines: 30 In article <1374@bragi.ctron.com> dj@balrog.ctron.com (DJ Delorie) writes: |>In article <1991Apr3.133226.22304@ibmpa.awdpa.ibm.com> dougs@claude1.rchland.ibm.com (J Doug Smith) writes: |>> I'm trying to write an application that will run another program and |>> get that program's output so it can be displayed to the user (much |>> like an editor runs a compiler and sends the compiler's output to the |>> user). Does anyone have any Ideas on how to accomplish this? Execing |>> another programs certainly is no problem, I just don't see how to get |>> the output from that program. |> |>The only safe way (ie: compatible) is: |> |> . . . |> rc = system("cc -c foo.c > /tmp/blat 2>&1"); |> rf = fopen("/tmp/blat", "r"); |> . . . |> |>but watch out for the 2>&1 on DOS :-) |> |>DJ |>dj@ctron.com Unfortunately, this assumes that you can trap the program's output using standard redirection. What about programs that write direct to video memory? Most of my programs do, and when I redirect them I get blank files. Same with redirecting input...I don't use the standard DOS int to get a character, I use bioskey() under Turbo C. Any way around this? Brian