ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl-poe
perl-poe
Flushing a FollowTail wheel.
by Mark Swayne other posts by this author
Nov 21 2006 6:19PM messages near this date
Working with archives | Re: Flushing a FollowTail wheel.
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
Thread:
Mark Swayne
Rocco Caputo

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved