|
Cache::Repository::Filesys - Filesystem driver for Cache::Repository |
Cache::Repository::Filesys - Filesystem driver for Cache::Repository
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');
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.
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:
dir_mapping => sub {
my $tag = shift;
$tag =~ s:/:_:;
$tag;
},
Use 1 to get exact numbers for total file size, but this is rarely what you really want (unless you're planning to put it in a tarball).
Returns: The Cache::Repository::Filesys object, or undef if the driver failed to initialise.
Darin McBride - dmcbride@cpan.org
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.
See TODO file.
|
Cache::Repository::Filesys - Filesystem driver for Cache::Repository |