-
Notifications
You must be signed in to change notification settings - Fork 0
/
FuseInterface.pm
71 lines (55 loc) · 967 Bytes
/
FuseInterface.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
use strict;
use warnings;
use Fuse;
use DBInterface;
package FuseInterface;
our $interface;
sub init
{
my ($dropbox, $mountpoint, $mountparams) = @_;
$mountparams->{dropbox} = $dropbox;
$interface = DBInterface->new($mountparams);
Fuse::main(mountpoint => $mountpoint,
getattr => \&FuseInterface::getattr,
getdir => \&FuseInterface::getdir,
mkdir => \&FuseInterface::mkdir,
unlink => \&FuseInterface::unlink,
rmdir => \&FuseInterface::rmdir,
rename => \&FuseInterface::rename,
read => \&FuseInterface::read,
statfs => \&FuseInterface::statfs,
);
}
sub getattr
{
return $interface->getattr(@_);
}
sub getdir
{
return $interface->getdir(@_);
}
sub mkdir
{
return $interface->mkdir(@_);
}
sub unlink
{
return $interface->unlink(@_);
}
sub rmdir
{
return $interface->rmdir(@_);
}
sub rename
{
return $interface->rename(@_);
}
sub read
{
return $interface->read(@_);
}
sub statfs
{
return $interface->statfs(@_);
}
1;