05-18-07 06:18 AM
On May 17, 9:55 pm, philbo30 <masfe...@gmail.com> wrote:
> Kind of a C / Linux question all in one; I hope this is the right
> group. This is more of an "approach" question than a code question.
> System is RH 7.3 with gcc 2.96
>
> Currently I'm redirecting stdout to /dev/ttyS0 with freopen() in order
> to write data to a kiosk printer. However, I also need to capture some
> of that data so that I can simultaneously write it to a mysql database
> immediately after (or immediately before) the ttyS0 output.
>
> One approach is just to run through the full app twice, changing the
> output function on the 2nd
> run. That sounds way too intensive, so I'm hoping perhaps there's some
> sort of "simultaneous" write function. Generally speaking, what's the
> best approach to this?
>
> In advance, thanks for a pointer in the write direction.
>
> -P3
Nevermind; solved my problem with fprintf()
[ Post a follow-up to this message ]
|