delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/03/10:32:56

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: <Pine DOT SUN DOT 3 DOT 91 DOT 981103113756 DOT 19001P-100000 AT is>
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
<eliz AT is DOT elta DOT co DOT il> 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!

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019