From: mapson AT mapson DOT com (Mapson) Newsgroups: comp.os.msdos.djgpp Subject: Re: redirecting stdout from within a DJGPP program Date: Tue, 03 Nov 1998 15:23:12 GMT Organization: Yale University Lines: 26 Message-ID: <363f1a74.87694419@news.cis.yale.edu> References: NNTP-Posting-Host: logan.eng.yale.edu X-Newsreader: Forte Free Agent 1.11/32.235 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Tue, 3 Nov 1998 11:38:56 +0200 (IST), Eli Zaretskii wrote: > >On Tue, 3 Nov 1998, Mapson wrote: > >> There is one point in my program where I call another program (using >> system("program.exe") ), and I am interested in redirecting (and >> silencing at the console) the output of that program to a file I >> already have opened for output. This is something I'd previously done >> in a batch file with ">>" > >How about system("program.exe >> file")? Doesn't that do what you want? I guess it does. And that sure is easy. If that is indeed the best way to do it, do it I shall! I've not used this system() command until a couple days ago. Now, because I'm trying to negate the need for external batch files with this compiler I've discussed elsewhere, I am relying on system() calls heavily, and I am a bit paranoid of it and of what penalties I may have to pay for suspending my program while I let other programs do a bunch of stuff. If you know of any particular dangers or "no-nos" regarding system() usage with DJGPP, please post. Thanks much, everybody!