Path: utzoo!attcan!uunet!samsung!xylogics!bu.edu!dartvax!eleazar.dartmouth.edu!emf From: emf@eleazar.dartmouth.edu (Eric Friets) Newsgroups: comp.lang.c Subject: redirecting output Message-ID: <22931@dartvax.Dartmouth.EDU> Date: 27 Jun 90 19:50:17 GMT Sender: news@dartvax.Dartmouth.EDU Distribution: na Organization: Dartmouth College, Hanover, NH Lines: 22 I need to redirect output in the middle of a program from the standard output to a file. The use of fprintf is ruled out because I do not have the source of the functions whose output I want. Options that are not acceptable: 1. redirect output of the entire program, as in prog > file 2. have the rest of the program write to stderr, and then redirect the entire program, as above 3. write the necessary data to a file, and have a smaller program that redirects to a file What is really needed is a way to change the pointer to stdout to a file pointer returned by fopen(). Any suggestions would be appreciated. I will summarize and post responses that are mailed to me. Eric Friets emf@eleazar.dartmouth.edu .