redirecting output
Eric Friets
emf at eleazar.dartmouth.edu
Thu Jun 28 05:50:17 AEST 1990
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 at eleazar.dartmouth.edu
.
More information about the Comp.lang.c
mailing list