Article View: comp.sys.amiga.tech
Article #6177Re: PIPEs
From: Gregory Kritsch
Date: Fri, 30 Oct 2020 01:22
Date: Fri, 30 Oct 2020 01:22
68 lines
3458 bytes
3458 bytes
Chuck.Phillips@FtCollins.NCR.COM (Chuck.Phillips) writes:
>>>>>> On 19 Oct 90 23:31:48 GMT, waggoner@dtg.nsc.com (Mark Waggoner) said:
>Mark> I don't know if this is quite what you want, but ConMan, the
>Mark> console handler by William Hawes can be mounted as a pipe handler and
>Mark> may provide what you are looking for. How exactly would you expect a
My only comment on this is that it is rather a large amount of code, and
not exactly supported either, since CBM has come up with similar
functionality elsewhere.
>Mark> may provide what you are looking for. How exactly would you expect a
>Mark> "true" pipe handler to work, without significant cooperation from the
>Mark> shell that is using the pipes.
Myself, I desire to be able to implement two functions. I know I can't
do this "properly" under 1.3, and I'm not sure about 2.0.
Here's the definitions, for the curious. I'd like to know if this IS
possible under 2.0, and if anyone can think of anything which can't be
done with this definition. (If it can't be done under 2.0, I will
eventually kludge it for 1.3 and see if it works with 2.0).
BPTR POpen(char *cl, int mode, BPTR stdio)
[First, I'm going to avoid some issues, like passing argc and argv,
redirecting stderr, and getting rid of BPTRs..., to keep the discussion
short and sweet].
This function will create a process and open a pipe to it as either the
standard input or output. A file handle to the pipe will be returned.
cl - standard command line. Redirection permitted, but only in one
direction.
mode - read or write mode pipe open. In read mode, the returned file
handle will be the readable side of a pipe, and all output from the
subprocess directed through Output() will be made available here. In
write mode, the writable side of a pipe will be returned, the readable
side will be the Input() of the subprocess.
stdio - specify the 'other' standard io file. For read mode, this will
correspond to the subprocess' Input(). For write mode, this will be the
subprocess' Output().
int PClose(BPTR pfh)
This function will close a process opened by POpen(). The important
detail is that it will WAIT FOR THE COMPLETION AND RETURN THE RESULT of
the subprocess.
pfh - the file handle (read or write) returned by POpen().
>The PIP: device? As I recall, the ARP shell _did_ use this for real (i.e.
>concurrent, no file redirect kludge) pipes.
I recall Michael Richardson asking me once if I knew how the conman pip:
worked. Neither of us could figure out how to open both ends of the
pipe.
>Chuck Phillips MS440
>NCR Microelectronics chuck.phillips%ftcollins.ncr.com
>2001 Danfield Ct.
>Ft. Collins, CO. 80525 ...uunet!ncrlnk!ncr-mpd!bach!chuckp
--
Gregory Kritsch | University of Waterloo
Fido: 1:221/208.11110 [1:163/109.30] | 1A Computer Engineering
UUCP: ggk@tirith.UUCP |--------------------------
...!watmath!xenitec!tirith!ggk | Amiga Fanatic
Technical Details
Message-ID:
<ggk.657249739@tirith.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!maytag!xenitec!tirith!ggkReferences:
<CHUCK.PHILLIPS.90Oct28025612@haydn.FtCollins.NCR.COM> <1990Oct19.044319.4851@engin.umich.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watserv1!maytag!xenitec!tirith!ggk From: ggk@tirith.UUCP (Gregory Kritsch) Message-ID: <ggk.657249739@tirith.UUCP> Date: 30 Oct 20 01:22:19 Newsgroups: comp.sys.amiga.tech Subject: Re: PIPEs Distribution: na In-Reply-To: Chuck.Phillips@FtCollins.NCR.COM (Chuck.Phillips) References: <CHUCK.PHILLIPS.90Oct28025612@haydn.FtCollins.NCR.COM> <1990Oct19.044319.4851@engin.umich.edu>