home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.x.motif
- Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!howland.reston.ans.net!paladin.american.edu!gatech!usenet.ins.cwru.edu!wsu-cs!vela!sglanger
- From: sglanger@vela.acs.oakland.edu (LANGER STEVEN C)
- Subject: HELP pipe communication?
- Message-ID: <1993Jan3.192240.1168@vela.acs.oakland.edu>
- Organization: Oakland University, Rochester MI.
- Distribution: na
- Date: Sun, 3 Jan 1993 19:22:40 GMT
- Lines: 50
-
- Hello all;
- Being , X, Motif programmer for about 3 weeks now, I
- apologise if the next questin is pretty primitive, but here goes.
-
- I've got a foreground X app that launches a child process (non-
- graphical) for data acquisition. I want to establish 2-way pipe
- communication between said parent-child.
-
- Vol 4 of the Xt Intrinsics Manual by Adrian Nye shows on pg.282-283
- how to use popen, but this only gives one way communication and
- since the example didn't show how to modify the child, I could
- not even get the example to work.
-
- Volume 6, Motif Programming Manual by Dan Heller on pg. 699 says,
-
- 1. call pipe to get the input and output channels
- 2. call fork to spawn the child
- 3. use dup2 on the child side to redirect stdout and stdin.
- 4. use XtAppAddInput to monitor the pipes.
-
- Sadly, there is no code example of this procedure.
-
- I've since gone to the man pages and I see that pipe(int *fildes)
- returns two ints;
- filedes[0] being for read and
- filedes[1] being for write
-
- XtAppAddInput requirs bona fide FILE pointers. How do I get them from
- pipes it returns? Also, my man server knows a total of 2
- sentences about buf2. I really could use a code fragment from both sides
- to put this puzzle together. Any UNIX interprocess communication
- GURUS with X experience out there? I'll post a summary of methods
- if there is interest.
-
- --thanks in advance, steve
-
-
- P.S. I'm running an SGI Indigo with Os 4.0.1
-
- --
- Steve Langer sglanger@argo.acs.oakland.edu (VMS)
- Oakland University sglanger@vela.acs.oakland.edu (Ultrix)
- ---------------------------------------------------------------------------
- Standard disclaimers apply. In addition, the author makes no guarantees,
- concerning the grammatical accuracy of his writing. Therefore, any ^B's, ^C's,
- midword character additions/deletions and other non-sense which occurs (after
- the work leaves the author's decade old text editor via his decade old Amiga,
- struggles through a local 1200 baud Merit server to be further mauled via the
- remote VAX mail servers) is someone elses problem - namely yours.
- ---------------------------------------------------------------------------
-