in reply to Re: Flush all opened STDIO streams
in thread Flush all opened STDIO streams

Sorry, but it did not work. Also, I tried:
STDERR->autoflush(1)
Another thing, that works is to recompile XS with fflush after logging:
fprintf(stderr, "..."); fflush(stderr);
but I can't install/update XS package on the production servers. May be anyone knows some perl module, that can do fflush(NULL)?

Replies are listed 'Best First'.
Re^3: Flush all opened STDIO streams
by Anonymous Monk on Feb 03, 2014 at 15:30 UTC

    What is the fileno of that c/xs stderr versus perl's STDERR?

    Maybe you can fake it

    sub flushall { for my $fileno (0..1024){ ## blah blah constants open my($fake), "<&=$fileno"; ## UGLY $fake->flush; } }

    Maybe you can fake it

    sub flushall { use POSIX(); for my $fileno (0.. POSIX::dup( fileno( STDERR) ) ){ open my($fake), ">&=$fileno"; ## UGLY $fake->flush; } }