The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Repository::Simple::Engine::FileSystem - Native file system repository storage

SYNOPSIS

  use Repository::Simple;
  my $fs = Repository::Simple->attach('FileSystem', root => '/usr/local');

DESCRIPTION

This repository maps directly into the native file system. The goal is to make this mapping as direct as possible with very few deviations from native features and functionality.

As of this documentation, the storage engine is capable of handling only files and directories. Symlinks, devices, FIFOs, or any other kind of file type is partially handled, but the specifics functionality provided by these certainly isn't address completely.

OPTIONS

This file system module accepts only a single option, root. If not given, the current working directory is assumed for the value root. All files returned by the file system will be rooted at the given (or assumed) point. No file outside of that point is accessible.

NODE TYPES

There are three node types used by this engine:

fs:object

This represents any non-file/non-directory file system object. The fs:file and fs:directory objects inherit from this. The stat properties are associated with this object.

fs:file

This represents a file object, i.e., anything that would pass the -f test. This object has the stat properties plus the fs:content property associated with it.

fs:directory

This represents a directory object, i.e., anything that would pass the -d test. This object has the stat properties associated with it. It may also have child nodes associated with it. The names and types of child nodes is not restricted.

NODE PROPERTIES

All file system nodes have stat properties associated with them. These properties are populated by the return of the stat() built-in subroutine. The stat properties are:

fs:dev

device number of file system

fs:ino

inode number

fs:mode

file mode (type and permissions)

number of (hard) links to the file

fs:uid

numeric user ID of file's owner

fs:gid

numeric group ID of file's owner

fs:rdev

the device identifier (special files only)

fs:size

total size of file, in bytes

fs:atime

last access time in seconds since the epoch

fs:mtime

last modify time in seconds since the epoch

fs:ctime

last change time in seconds since the epoch

fs:blksize

preferred block size for file system I/O

fs:blocks

actual number of blocks allocated

The definitions were taken from the documentation in perlfunc. Each of these will be an integer number. Once modification is implemented, the fs:mode, fs:uid, fs:gid, fs:atime, fs:mtime, and fs:ctime fields will be updatable. All other fields are not updatable. All of these fields are auto_created and all or not removable.

In addition to these properties, fs:file nodes also have an fs:content property, which will contain the file contents. You may wish to grab this data via the get_handle() method rather than get_scalar().

SEE ALSO

Repository::Simple

AUTHOR

Andrew Sterling Hanenkamp, <hanenkamp@cpan.org>

LICENSE AND COPYRIGHT

Copyright 2006 Andrew Sterling Hanenkamp <hanenkamp@cpan.org>. All Rights Reserved.

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.