Fuse::Class - Base clsas for Fuse module implementation using class.


Fuse-Class documentation  | view source Contained in the Fuse-Class distribution.

Index


NAME

Top

Fuse::Class - Base clsas for Fuse module implementation using class.

VERSION

Top

Version 0.01

SYNOPSIS

Top

Fuse::Class is just a abstract class. First, you must write subclass overriding methods like named 'getattr'. (callbacks defined in Fuse)

Subclass will be written like following:

    package SampleFS;

    use base qw(Fuse::Class);

    sub getattr {
        my $self = shift; # instance or class is passed as first argment.
        my ($fname) = @_; # same as Fuse.

        ...

        return @attr; # same as Fuse.
    }
        ...

To mount your filesystem:

   use SampleFS;

   my $fuse = SampleFS->new("your", "parameters", "here");
   $fuse->main(mountpoint => '/mnt/sample', mountopts => "allow_other");




DESCRIPTION

Top

This module supports writing Fuse callback as method. Method name is same as Fuse callback, but first argment is object.

This is a small change for Fuse, but you can use power of OO like inheritance, encapsulation, ...

Exception handling:

Return value will be treated as errno in Fuse way, but you can use exception, too. If exception is thrown in your method (die is called), $! will be used as errno to notify error to Fuse.

EXPORT

Top

Nothing.

FUNCTIONS

Top

main

Same as defined in Fuse::main.

new

Create a new instance.

getattr

Same as Fuse.

getdir

Same as Fuse.

mknod

Same as Fuse.

mkdir

Same as Fuse.

rmdir

Same as Fuse.

rename

Same as Fuse.

statfs

Same as Fuse. By default implementation, returns -ENOANO. You can leave this method if your FS does not have statfs.

flush

Same as Fuse. By default implementation, returns 0. You can leave this method if your FS does not have flush.

release

Same as Fuse. By default implementation, returns 0. You can leave this method if your FS does not need anything when releaing.

fsync

Same as Fuse. By default implementation, returns 0. You can leave this method if your FS does not have fsync.

getxattr

Same as Fuse. By default implementation, returns 0. You can leave this method if your FS does not have any extended attrs.

listxattr

Same as Fuse. By default implementation, returns 0. You can leave this method if your FS does not have any extended attrs.

removexattr

Same as Fuse. By default implementation, returns 0. You can leave this method if your FS does not have any extended attrs.

setxattr

Same as Fuse. By default implementation, returns -ENOATTR. You can leave this method if your FS does not have any extended attrs.

AUTHOR

Top

Toshimitsu FUJIWARA, <tttfjw at gmail.com>

BUGS

Top

Threading is not tested.

COPYRIGHT & LICENSE

Top

SEE ALSO

Top

Fuse


Fuse-Class documentation  | view source Contained in the Fuse-Class distribution.