www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/12/28/20:13:35

Message-ID: <DB85AFBE7C0DD311BF260004ACB80BFCECEC@nex_server.nextransport.com>
From: George Kinney <GKinney AT nextransport DOT com>
To: "'djgpp AT delorie DOT com'" <djgpp AT delorie DOT com>
Date: Tue, 28 Dec 1999 14:21:18 -0500
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2448.0)
Reply-To: djgpp AT delorie DOT com

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01BF5168.B7384992
Content-Type: text/plain

From: Laurence Withers <lwithers AT lwithers DOT demon DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Accessing stdin, stdout and stderr?
Date: Sun, 26 Dec 1999 18:01:16 +0000
Message-ID: <D3oJTCAsflZ4EASq AT lwithers DOT demon DOT co DOT uk>
NNTP-Posting-Host: lwithers.demon.co.uk
X-NNTP-Posting-Host: lwithers.demon.co.uk:194.222.80.1
X-Trace: news.demon.co.uk 946231383 nnrp-09:22290 NO-IDENT
lwithers.demon.co.uk:194.222.80.1
X-Complaints-To: abuse AT demon DOT net
MIME-Version: 1.0
X-Newsreader: Turnpike (32) Version 4.01  <WCcCG$mmNL32sYSf46vBeC80CR>
To: djgpp AT delorie DOT com
>A program I am writing runs external programs through the "system"
>command. However, I need to access their stdin, stdout and stderr
>streams. I have looked at the 'redir' sources, but they just redirect
>through file handles. I need more control than this: I need to
>immediately have access to stdout and stderr, and stdin will be handled
>by my own keyboard handler. Is this possible?

look into the library function: popen

It will allow you to open a programs input or output stream for writing and 
reading, but I don't know that it will give you the kind of control you seem

to be after.  Anyways, its a start.

------_=_NextPart_001_01BF5168.B7384992
Content-Type: text/html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=US-ASCII">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2448.0">
<TITLE></TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2 FACE="Arial">From: Laurence Withers &lt;lwithers AT lwithers DOT demon DOT co DOT uk&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">Newsgroups: comp.os.msdos.djgpp</FONT>
<BR><FONT SIZE=2 FACE="Arial">Subject: Accessing stdin, stdout and stderr?</FONT>
<BR><FONT SIZE=2 FACE="Arial">Date: Sun, 26 Dec 1999 18:01:16 +0000</FONT>
<BR><FONT SIZE=2 FACE="Arial">Message-ID: &lt;D3oJTCAsflZ4EASq AT lwithers DOT demon DOT co DOT uk&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">NNTP-Posting-Host: lwithers.demon.co.uk</FONT>
<BR><FONT SIZE=2 FACE="Arial">X-NNTP-Posting-Host: lwithers.demon.co.uk:194.222.80.1</FONT>
<BR><FONT SIZE=2 FACE="Arial">X-Trace: news.demon.co.uk 946231383 nnrp-09:22290 NO-IDENT lwithers.demon.co.uk:194.222.80.1</FONT>
<BR><FONT SIZE=2 FACE="Arial">X-Complaints-To: abuse AT demon DOT net</FONT>
<BR><FONT SIZE=2 FACE="Arial">MIME-Version: 1.0</FONT>
<BR><FONT SIZE=2 FACE="Arial">X-Newsreader: Turnpike (32) Version 4.01&nbsp; &lt;WCcCG$mmNL32sYSf46vBeC80CR&gt;</FONT>
<BR><FONT SIZE=2 FACE="Arial">To: djgpp AT delorie DOT com</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt;A program I am writing runs external programs through the &quot;system&quot;</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt;command. However, I need to access their stdin, stdout and stderr</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt;streams. I have looked at the 'redir' sources, but they just redirect</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt;through file handles. I need more control than this: I need to</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt;immediately have access to stdout and stderr, and stdin will be handled</FONT>
<BR><FONT SIZE=2 FACE="Arial">&gt;by my own keyboard handler. Is this possible?</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">look into the library function: popen</FONT>
</P>

<P><FONT SIZE=2 FACE="Arial">It will allow you to open a programs input or output stream for writing and </FONT>
<BR><FONT SIZE=2 FACE="Arial">reading, but I don't know that it will give you the kind of control you seem </FONT>
<BR><FONT SIZE=2 FACE="Arial">to be after.&nbsp; Anyways, its a start.</FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01BF5168.B7384992--

- Raw text -


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