Same as defined in Fuse::main.
| Fuse-Class documentation | view source | Contained in the Fuse-Class distribution. |
Fuse::Class - Base clsas for Fuse module implementation using class.
Version 0.01
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");
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.
Nothing.
Same as defined in Fuse::main.
Create a new instance.
Same as Fuse.
Same as Fuse. By Default implementation, returns -ENOENT. You can leave this method if your FS does not have symlink.
Same as Fuse.
Same as Fuse.
Same as Fuse.
Same as Fuse.
Same as Fuse.
Same as Fuse.
Same as Fuse.
Same as Fuse. By default implementation, returns -ENOANO. You can leave this method if your FS does not have statfs.
Same as Fuse. By default implementation, returns 0. You can leave this method if your FS does not have flush.
Same as Fuse. By default implementation, returns 0. You can leave this method if your FS does not need anything when releaing.
Same as Fuse. By default implementation, returns 0. You can leave this method if your FS does not have fsync.
Same as Fuse. By default implementation, returns 0. You can leave this method if your FS does not have any extended attrs.
Same as Fuse. By default implementation, returns 0. You can leave this method if your FS does not have any extended attrs.
Same as Fuse. By default implementation, returns 0. You can leave this method if your FS does not have any extended attrs.
Same as Fuse. By default implementation, returns -ENOATTR. You can leave this method if your FS does not have any extended attrs.
Toshimitsu FUJIWARA, <tttfjw at gmail.com>
Threading is not tested.
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.
Fuse
| Fuse-Class documentation | view source | Contained in the Fuse-Class distribution. |