Mail Archives: djgpp/1999/12/28/20:13:35
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 <lwithers AT lwithers DOT demon DOT co DOT uk></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: <D3oJTCAsflZ4EASq AT lwithers DOT demon DOT co DOT uk></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 <WCcCG$mmNL32sYSf46vBeC80CR></FONT>
<BR><FONT SIZE=2 FACE="Arial">To: djgpp AT delorie DOT com</FONT>
<BR><FONT SIZE=2 FACE="Arial">>A program I am writing runs external programs through the "system"</FONT>
<BR><FONT SIZE=2 FACE="Arial">>command. However, I need to access their stdin, stdout and stderr</FONT>
<BR><FONT SIZE=2 FACE="Arial">>streams. I have looked at the 'redir' sources, but they just redirect</FONT>
<BR><FONT SIZE=2 FACE="Arial">>through file handles. I need more control than this: I need to</FONT>
<BR><FONT SIZE=2 FACE="Arial">>immediately have access to stdout and stderr, and stdin will be handled</FONT>
<BR><FONT SIZE=2 FACE="Arial">>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. Anyways, its a start.</FONT>
</P>
</BODY>
</HTML>
------_=_NextPart_001_01BF5168.B7384992--
- Raw text -