home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 18830 < prev    next >
Encoding:
Internet Message Format  |  1992-12-23  |  1.1 KB

  1. Path: sparky!uunet!spool.mu.edu!olivea!charnel!sifon!thunder.mcrcim.mcgill.edu!mouse
  2. From: mouse@thunder.mcrcim.mcgill.edu (der Mouse)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: stderr: Question
  5. Keywords: fprintf stderr
  6. Message-ID: <1992Dec23.172219.11906@thunder.mcrcim.mcgill.edu>
  7. Date: 23 Dec 92 17:22:19 GMT
  8. References: <1992Dec21.134608.16856@ifi.unizh.ch>
  9. Organization: McGill Research Centre for Intelligent Machines
  10. Lines: 19
  11.  
  12. In article <1992Dec21.134608.16856@ifi.unizh.ch>, caliaro@avalon.physik.unizh.ch (Aurelio Caliaro) writes:
  13.  
  14. > I would like to redirect all output made by "fprintf(stderr, ...)" to
  15. > a procedure.  Is that possible without changing the source everytime
  16. > that stderr comes?
  17.  
  18. No, and not really even then.  Standard stdio has little or no support
  19. for coroutine streams.  (My stdio does, in the form of fopenfxn(), and
  20. it's useful.  But it's a long way from standard, and isn't even
  21. redistributable (yet).)
  22.  
  23. Depending on precisely what effect you're trying to achieve, you may be
  24. able to get it by forking a process to which you then connect stderr,
  25. and having it do whatever you want.
  26.  
  27.                     der Mouse
  28.  
  29.                 mouse@larry.mcrcim.mcgill.edu
  30.