| Fuse-Template documentation | Contained in the Fuse-Template distribution. |
Fuse::Template::Root - Root filesystem object
package Class;
# will import RootObject typeconstraint
use Fuse::Template::Root qw/RootObject/;
has foo => ( isa => RootObject, coerce => 1 );
...
package main;
# same result:
my $obj = Class->new( foo => { path => $some_root } );
my $obj = Class->new( foo => $some_root );
my $obj = Class->new(
foo => Fuse::Template::Root->new({
path => $some_root
}),
);
The RootObject can coerce either Str and HashRef into a
Fuse::Template::Root object. The HashRef will be used as object
constructor, while the Str will be set as path attribute.
Holds a string representing the path to where the template files exist. This attribute is required.
Holds the file mode for the target mount directory. Default value
is 0775. (octal value)
The user id of who owns the target mount path. Defaults to the
$REAL_USER_ID
The group id of who owns the target mount path. Defaults to
the first integer from $REAL_GROUP_ID.
Last change time of the target mount path. Defaults to
time when the object got created.
Last modify time of the target mount path. Defaults to
time when the object got created.
Last access time of the target mount path. Defaults to
time when the object got created.
Preferred block size for file system I/O. Defaults to 1024. (The default value might change)
See Fuse::Template
| Fuse-Template documentation | Contained in the Fuse-Template distribution. |
package Fuse::Template::Root;
use Moose; use MooseX::Types -declare => [qw/RootObject/]; use MooseX::Types::Moose qw(:all); use overload q("") => sub { shift->path }, fallback => 1; subtype RootObject, as Object; coerce RootObject, ( from Str, via { Fuse::Template::Root->new(path => $_) }, from HashRef, via { Fuse::Template::Root->new($_) }, );
has path => ( is => 'ro', isa => 'Str', required => 1, );
has mode => ( is => 'ro', isa => 'Int', default => 0775, ); around mode => sub { my $next = shift; my $self = shift; return @_ ? $self->$next((0040 << 9) + $_[0]) : $self->$next; };
has uid => ( is => 'ro', isa => 'Int', default => $<, );
has gid => ( is => 'ro', isa => 'Int', default => sub { $( =~ /(\d+)/ }, );
has ctime => ( is => 'ro', isa => 'Int', default => time, );
has mtime => ( is => 'ro', isa => 'Int', default => time, );
has atime => ( is => 'ro', isa => 'Int', default => time, );
has block_size => ( is => 'ro', isa => 'Int', default => 1024, );
1;