home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / windows / x / motif / 8302 < prev    next >
Encoding:
Text File  |  1993-01-03  |  2.5 KB  |  61 lines

  1. Newsgroups: comp.windows.x.motif
  2. 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
  3. From: sglanger@vela.acs.oakland.edu (LANGER STEVEN C)
  4. Subject: HELP pipe communication?
  5. Message-ID: <1993Jan3.192240.1168@vela.acs.oakland.edu>
  6. Organization: Oakland University, Rochester MI.
  7. Distribution: na
  8. Date: Sun, 3 Jan 1993 19:22:40 GMT
  9. Lines: 50
  10.  
  11. Hello all;
  12.  Being , X, Motif programmer for about 3 weeks now, I 
  13. apologise if the next questin is pretty primitive, but here goes.
  14.  
  15. I've got a foreground X app that launches a child process (non-
  16. graphical) for data acquisition. I want to establish 2-way pipe
  17. communication between said parent-child.
  18.  
  19. Vol 4 of the Xt Intrinsics Manual by Adrian Nye shows on pg.282-283
  20. how to use popen, but this only gives one way communication and
  21. since the example didn't show how to modify the child, I could
  22. not even get the example to work.
  23.  
  24. Volume 6, Motif Programming Manual by Dan Heller on pg. 699 says,
  25.  
  26. 1. call pipe to get the input and output channels
  27. 2. call fork to spawn the child
  28. 3. use dup2 on the child side to redirect stdout and stdin.
  29. 4.  use XtAppAddInput to monitor the pipes.
  30.  
  31.   Sadly, there is no code example of this procedure.
  32.  
  33. I've since gone to the man pages and I see that pipe(int *fildes)
  34. returns two ints;
  35.     filedes[0] being for read and
  36.     filedes[1] being for write
  37.  
  38. XtAppAddInput requirs bona fide FILE pointers. How do I get them from
  39. pipes it  returns? Also, my man server knows a total of 2 
  40. sentences about buf2. I really could use a code fragment from both sides
  41. to put this puzzle together.  Any UNIX interprocess communication
  42. GURUS with X experience out there? I'll post a summary of methods
  43. if there is interest.
  44.  
  45. --thanks in advance, steve
  46.  
  47.  
  48. P.S. I'm running an SGI Indigo with Os 4.0.1
  49.  
  50. -- 
  51. Steve Langer                     sglanger@argo.acs.oakland.edu (VMS)
  52. Oakland University               sglanger@vela.acs.oakland.edu (Ultrix)
  53. ---------------------------------------------------------------------------
  54. Standard disclaimers apply. In addition, the author makes no guarantees,
  55. concerning the grammatical accuracy of his writing. Therefore, any ^B's, ^C's, 
  56. midword character additions/deletions and other non-sense which occurs (after 
  57. the work leaves the author's decade old text editor via his decade old Amiga, 
  58. struggles through a local 1200 baud Merit server to be further mauled via the 
  59. remote VAX mail servers) is someone elses problem - namely yours.
  60. ---------------------------------------------------------------------------
  61.