Flux::File - file storage
$storage = Flux::File->new($filename); $in = $storage->in( Flux::File::Cursor->new($posfile) );
This is a simplest implementation of
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 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.
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
Vyacheslav Matyukhin <email@example.com>
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.