The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Cache::Repository::Filesys - Filesystem driver for Cache::Repository

SYNOPSIS

  my $rep = Cache::Repository->new(
      style => 'Filesys',
      # options for the F::R driver
    );
  $rep->add_files(tag => 'groupname',
                  files => \@filenames,
                  basedir => '/tmp',
                  move => 1,
                 );
  $rep->add_filehandle(tag => 'anothergroup',
                       filename => 'blah',
                       filehandle => $fh,
                       mode => 0755);
  $rep->set_meta(tag => 'groupname',
                 meta => {
                     title => 'blah',
                     author => 'foo',
                 });

  $rep->retrieve(tag => 'groupname', dest => '/newdir');
  my $data = $rep->get_meta(tag => 'groupname');

DESCRIPTION

Caching in a locally-mounted filesystem. Eventually, this will include NFS-level locking, but for now, this module assuming only a single process accessing the repository in write mode at a time.

FUNCTIONS

new

Cache::Repository::Filesys constructor.

    my $r = Cache::Repository::Filesys->new(
                                            path => '/some/path/with/enough/space',
                                           );

or

    my $r = Cache::Repository->new(
                                   style => 'Filesys',
                                   path => '/some/path/with/enough/space',
                                  );

Parameters:

path

The path in which to store the repository.

clear

If true, clear the repository (if it exists) to start anew. Existing files and meta information will all be removed.

compress

The compress option is ignored in the current version.

Returns: The Cache::Repository::Filesys object, or undef if the driver failed to initialise.

clear_tag
add_files =item add_filehandle
retrieve_with_callback
get_size
list_files
list_tags

See Cache::Repository for documentation on these.

AUTHOR

Darin McBride - dmcbride@cpan.org

COPYRIGHT

Copyright 2005 Darin McBride.

You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.

BUGS

See TODO file.