Catman...::Index(3pm)
π Catman...::Index(3pm) π
okay bestie, pull up a chair because this one is a whole situation and it's lowkey iconic π«Ά This page is Catman...::Index(3pm) from the User Contributed Perl Documentation, and it's all about the index of every single "Folder" living inside a Catmandu::Store::File::FedoraCommons. Yes, folders. Yes, all of them. No cap. πΈ
β¨ NAME β¨
Catmandu::Store::File::FedoraCommons::Index β it's literally the Index of all "Folders" in a Catmandu::Store::File::FedoraCommons. That's the whole gig. It's giving organised. π
π¦ SYNOPSIS π¦
okay so here's the vibe, bestie β copy this exactly, don't freestyle it:
use Catmandu;
my $store = Catmandu->store('File::FedoraCommons'
, baseurl => 'http://localhost:8080/fedora'
, username => 'fedoraAdmin'
, password => 'fedoraAdmin'
, namespace => 'demo'
, purge => 1);
my $index = $store->index;
# List all containers
$index->each(sub {
my $container = shift;
print "%s\n" , $container->{_id};
});
# Add a new folder
$index->add({_id => '1234'});
# Delete a folder
$index->delete(1234);
# Get a folder
my $folder = $index->get(1234);
# Get the files in an folder
my $files = $index->files(1234);
$files->each(sub {
my $file = shift;
my $name = $file->_id;
my $size = $file->size;
my $content_type = $file->content_type;
my $created = $file->created;
my $modified = $file->modified;
$file->stream(IO::File->new(">/tmp/$name"), file);
});
# Add a file
$files->upload(IO::File->new("<data.dat"),"data.dat");
# Retrieve a file
my $file = $files->get("data.dat");
# Stream a file to an IO::Handle
$files->stream(IO::File->new(">data.dat"),$file);
# Delete a file
$files->delete("data.dat");
# Delete a folders
$index->delete("1234");
so yeah, you set up your $store, you grab your $index, and then you're living β listing containers, adding folders, deleting folders, getting folders, grabbing the files inside a folder, uploading, retrieving, streaming, deleting. It's a whole workflow and honestly? obsessed. πβ¨
π INHERITED METHODS π
bestie, this Catmandu::Bag implements the following β aka it inherited these bad boys and they're part of the family now:
- Catmandu::Bag
- Catmandu::FileBag::Index
- Catmandu::Droppable
fr fr, that's the list βCatmandu::Bag,Catmandu::FileBag::Index, andCatmandu::Droppable. All three, no extras, no notes. π
and that's the whole page, bestie!! πβ¨ this lil' manual page is from perl v5.36.0, dated 2023-02-05, and it's filed under the Catman...::Index(3pm) entry in the User Contributed Perl Documentation. slay, you read the whole thing, main character energy for real π¦πΈπ
π¦ where this page comes from
- debian bookworm: libcatmandu-fedoracommons-perl 0.5-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcatmandu-fedoracommons-perl 0.5-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcatmandu-fedoracommons-perl 0.5-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcatmandu-fedoracommons-perl 0.5-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-fedoracommons-perl 0.5-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms