NAME

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

VERSION

Version 0.01

SYNOPSIS

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

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

Nothing.

FUNCTIONS

main

Same as defined in Fuse::main.

new

Create a new instance.

getattr

Same as Fuse.

Same as Fuse. By Default implementation, returns -ENOENT. You can leave this method if your FS does not have symlink.

getdir

Same as Fuse.

mknod

Same as Fuse.

mkdir

Same as Fuse.

Same as Fuse.

rmdir

Same as Fuse.

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

Toshimitsu FUJIWARA, <tttfjw at gmail.com>

BUGS

Threading is not tested.

COPYRIGHT & LICENSE

Copyright 2008 Toshimitsu FUJIWARA, all rights reserved.

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

SEE ALSO

Fuse