---
name: "Catmandu::FileBag::Index"
section: "3pm"
platform: "linux"
package: "libcatmandu-filestore-perl"
version: "1.16-3"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Catmandu::FileBag::Index"
---

# Catmandu::FileBag::Index(3pm)

Flag a Bag as a FileStore Index

## NAME

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

## 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');
```

## 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

## SEE ALSO

Catmandu::FileStore , Catmandu::FileBag
