dmitnin has asked for the wisdom of the Perl Monks concerning the following question:
Hello, guys!
I use some XS library, that writes to stderr itself log by the libc fprintf() function. In perl script I wanna catch all stderr, produced by this library, but I couldn't, due to stdio makes output buffered.
Code like:
did not help, because XS and perl code have the same file descriptor (2), but the different bound stdio buffers.select(STDERR); $| = 1;
The only thing, that helped me, is flushing of all open output streams:
Please, can anyone help me to make this flush without using of C inlined code?use Inline C => <<'END_C'; void make_flush() { fflush(NULL); } END_C
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Flush all opened STDIO streams
by Anonymous Monk on Feb 03, 2014 at 12:57 UTC | |
by dmitnin (Initiate) on Feb 03, 2014 at 14:20 UTC | |
|
Re: Flush all opened STDIO streams
by Anonymous Monk on Feb 03, 2014 at 13:01 UTC | |
by dmitnin (Initiate) on Feb 03, 2014 at 14:10 UTC | |
by Anonymous Monk on Feb 03, 2014 at 15:30 UTC | |
|
Re: Flush all opened STDIO streams
by oiskuu (Hermit) on Feb 03, 2014 at 16:57 UTC | |
by Anonymous Monk on Feb 03, 2014 at 20:36 UTC | |
|
Re: Flush all opened STDIO streams
by dmitnin (Initiate) on Feb 04, 2014 at 12:12 UTC |