Article View: comp.unix.programmer
Article #82Re: Bidirectional Pipes
From: rjk
Date: Thu, 16 Jul 1992 15:39
Date: Thu, 16 Jul 1992 15:39
27 lines
1555 bytes
1555 bytes
In article <1992Jul14.061826.11689@Unibase.SK.CA> roe@Unibase.SK.CA (Roe Peterson) writes:
890025d@dragon.acadiau.ca (Andy DeWolfe) writes:
>Can anyone provide examples/references/information on setting up
>bidirectional pipes using "C"/Unix?
Sorry, but there is no such beastie as a bi-directional pipe. The
pipe(2) system call will return two file descriptors, one open for
write, and one open for read. Have the reader close the write end, and
the writer close the read end.
You can't use pipe to communicate in both direction over one file
descriptor.
Actually, all pipes under System V R4 are bidirectional. From pipe(2):
"pipe creates an I/O mechanism called a pipe and returns two file
descriptors, fildes[0] and fildes[1]. The files associated with fildes[0]
and fildes[1] are streams and are both opened for reading and writing."
--
Rich Kuhns {uunet,nstar}!sawmill!rjk
PO Box 6249
100 Sawmill Road
Lafayette, IN 47903
(317)477-6000 (days)
Technical Details
Message-ID:
<RJK.92Jul16093905@sawdust.sawmil>Path:
arc1-ca.pugleaf.net!sparky!uunet!mcsun!fuug!demos!kiae!glas!demos!sawdust.sawmill.uucp!rjkReferences:
<1992Jul13.175933.26213@dragon.ac>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!fuug!demos!kiae!glas!demos!sawdust.sawmill.uucp!rjk From: rjk@sawdust.sawmill.uucp Newsgroups: comp.unix.programmer Date: 16 Jul 92 09:39 MDT Subject: Re: Bidirectional Pipes Sender: Notesfile to Usenet Gateway <notes@glas.apc.org> Message-ID: <RJK.92Jul16093905@sawdust.sawmil> References: <1992Jul13.175933.26213@dragon.ac> Nf-ID: #R:1992Jul13.175933.26213@dragon.ac:1952253999:RJK.92Jul16093905@sawdust.sawmil:-328824565:001:989 Nf-From: sawdust.sawmill.uucp!rjk Jul 16 09:39:00 1992 Lines: 28