----- Original Message -----
Sent: Thursday, June 05, 2003 10:59
AM
Subject: [Linux dev] Re: [C] One file
pointer to write to 2 files
> > In C can I associate a single file pointer to 2
output
> files. I.e. I want to
> > write the same data to 2 different files. The "dup" and
> "dup2" function
> >
calls allows one to duplicate a file pointer to a single
> destination. Or am
> > I missing the
plot here?
>
> Not
quite... :)
>
> No, I
don't yet know of a system call method to do it, but if
> you "have to"
> I faked it before with
a FIFO + the GNU utils' tee, though that was
> only
in appending mode.
>
>
Perhaps why do you want it and what do you ned to achieve?
>
Hi,
Basically, I want to write the same data to 2 files.
It seems rather tedious to have to do this:
fprintf(fp1,"data....");
fprintf(fp2,"data....");
everytime. The data is exactly the same.
There are a couple of hundred places where this needs to
happen.
I'm sure I can cook up something messing with a new FILE*
type.
Just wanted to know if there was some other
standard function I am unaware of.
Thanks and regards.
Nimish