Repository::Simple::Engine::FileSystem - Native file system repository storage
use Repository::Simple; my $fs = Repository::Simple->attach('FileSystem', root => '/usr/local');
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.
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.
There are three node types used by this engine:
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.
This represents a file object, i.e., anything that would pass the
-ftest. This object has the stat properties plus the fs:content property associated with it.
This represents a directory object, i.e., anything that would pass the
-dtest. 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.
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:
device number of file system
file mode (type and permissions)
number of (hard) links to the file
numeric user ID of file's owner
numeric group ID of file's owner
the device identifier (special files only)
total size of file, in bytes
last access time in seconds since the epoch
last modify time in seconds since the epoch
last change time in seconds since the epoch
preferred block size for file system I/O
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
Andrew Sterling Hanenkamp, <firstname.lastname@example.org>
Copyright 2006 Andrew Sterling Hanenkamp <email@example.com>. 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.