Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!balrog!dj From: dj@balrog.ctron.com (DJ Delorie) Newsgroups: comp.os.msdos.programmer Subject: Re: Spawning processes in DOS Message-ID: <1374@bragi.ctron.com> Date: 3 Apr 91 22:22:33 GMT References: <1991Apr3.133226.22304@ibmpa.awdpa.ibm.com> Organization: None whatsoever Lines: 19 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