Flux::File - file storage
version 1.01
$storage = Flux::File->new($filename); $in = $storage->in( Flux::File::Cursor->new($posfile) );
This is a simplest implementation of Flux::Storage.
Flux::Storage
It stores lines by appending them to the file. It supports clients identifiable by Flux::File::Cursor objects.
It also have several options for fine control over performance vs data consistency trade-off. (See the constructor documentation below.)
Create new object. $file should be a name of any writable file into which lines will be appended.
$file
If $file does not yet exist, it will be created.
Options can contains the following keys:
Get lock on each write (useful when many processes writes in one file).
Reopen file on each write (useful for files, which can be rotated).
Truncate file to the last endline (useful when your unit for writings is a single lines and you don't want to have a hanging lines in your log in case of failure). If reopen is true, then file checks on each flush, otherwise it will be checked only at first flush.
reopen
Write a new line into the file.
Write multiple lines into the file.
Construct the input stream which reads the file starting from the position saved in $posfile.
$posfile
Vyacheslav Matyukhin <me@berekuk.ru>
This software is copyright (c) 2013 by Yandex LLC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Flux::File, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Flux::File
CPAN shell
perl -MCPAN -e shell install Flux::File
For more information on module installation, please visit the detailed CPAN module installation guide.