Labrador::Common::FileWriter
use Labrador::Common::FileWriter; my $writer = new Labrador::Common::FileWriter('/tmp/testwrites%%.log', 5); for(my $i=0;$i<rand(10);$i++) { for (my $j=0;$j<rand(10); $i++) { my $fileh = $writer->write(); print $fileh "$i $j\n"; } } $writer->finish;
Provides a filehandle that rolls over to the next file after a constant number of writes.
Constructor. $maxwrites is the limit to the number of times write() can be called before a new filehandle will be opened. If $compress is set, then the file is compressed by calling gzip when each file is closed.
Returns a filehandle of an open file, and incremenents writecounter. If writecounter's maximum is exceeded, then the current file is closed and a new file opened.
Close the filehandle.
As usual, these should be never manipulated by external objects directly. Documentation is provided for completeness only.
Returns the name of the file to be opened given the object's current state.
Opens a new file.
Closes the currently open file.
$Revision: 1.6 $