NAME

Filesys::POSIX::Mem - In-memory filesystem implementation

SYNOPSIS

my $fs = Filesys::POSIX->new(Filesys::POSIX::Mem->new,
    'noatime' => 1
);

$fs->mkdir('/mnt');
$fs->mount(Filesys::POSIX::Mem->new, '/mnt',
    'noatime' => 1
);

DESCRIPTION

Provides the base class representing an instance of the memory file system. All inode and directory entry data lives completely in memory, or in temporary files referenced by inode buckets as provided by Filesys::POSIX::Mem::Bucket file handles.

MOUNT OPTIONS

The following options are honored. They modify the behavior of the file handle object implemented by Filesys::POSIX::Mem::Bucket.

bucket_dir

When new files are created within a Filesys::POSIX::Mem filesystem, temporary files in the actual underlying filesystem may be created to hold their contents. The bucket_dir option specifies the base directory in which these temporary files are placed, defaulting to /tmp.

bucket_max

Specifies the maximum size, in bytes, any given file within a Filesys::POSIX::Mem filesystem may reach within memory before its contents are flushed to and managed within a temporary disk file. The default size is 16384 bytes.

CREATING AND INITIALIZING THE FILESYSTEM

Filesys::POSIX::Mem->new

Creates a new, unmounted filesystem. The root inode of this filesystem is created as a directory with 0755 permissions.

$fs->init(%flags)

Stores the flags passed in the current filesystem object. This method is usually called by Filesys::POSIX::Mount when said filesystem object is mounted. These mount flags can be retrieved later.

DESTROYING THE FILESYSTEM

The filesystem object, as well as any of its constituent inodes, directories, and other data are cleaned up completely when the DESTROY() method is called.