logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Catmandu::FileBag::Index - Flag a Bag as a FileStore Index

Description

       Each Catmandu::FileBag is a Catmandu::Bag and inherits all its methods.

Methods

files($id)
       Return the Catmandu::FileBag for this Catmandu::FileStore containing all the files

Name

       Catmandu::FileBag::Index - Flag a Bag as a FileStore Index

See Also

       Catmandu::FileStore , Catmandu::FileBag

perl v5.40.0                                       2025-01-17                      Catmandu::FileBag::Index(3pm)

Synopsis

           use Catmandu;

           my $store = Catmandu->store('Simple' , root => 't/data');

           # List all containers
           $store->bag->each(sub {
               my $container = shift;

               print "%s\n" , $container->{_id};
           });

           # Add a new folder
           $store->bag->add({ _id => '1234' });

           # Get the v
           my $files = $store->bag->files('1234');

           # Add a file to the files
           $files->upload(IO::File->new('<foobar.txt'), 'foobar.txt');

           # Stream the contents of a file
           $files->stream(IO::File->new('>foobar.txt'), 'foobar.txt');

           # Delete a file
           $files->delete('foobar.txt');

           # Delete a folder
           $store->bag->delete('1234');

See Also