Is it possible to flush the contents of a POE::Wheel::FollowTail wheel?
I am using one to monitor a file that is left with a non '\n' terminated
line at when the process that creates it is finished.
What I'd like to be able to do before closing is somthing like:
sub finish_file {
my $heap = $_[HEAP];
$heap->{wheel}->flush; # this should generate an InputEvent with any
dangling bits left in the buffer.
# do other stuff here
}
Or even better:
$heap->{follow_tail} = POE::Wheel::FollowTail->new(
Filename => $logfile,
InputEvent => 'got_line',
ErrorEvent => 'got_error',
FlushAtClose => 1, # Enable an automatic buffer flush as the
wheel is destroyed.
);
TIA,
--Mark