From: Martin B. <ma...@se...> - 2011-09-07 09:36:25
|
Hello, I have a issue with reading out files. Whenever I invoke "cat" on file I dont get anything returned. Since I am a complete newbie to Fuse I have no clue how to track the issue down. In order to try to track it down I wrote a simple test filesystem in perl and I enabled debugging as well. Do you have any suggestions? Could you point out what I did wrong? Thanks, Martin Barth perl testfs.pl /home/barth/mnt/temp fusermount: unknown parameter in /etc/fuse.conf at line 10: 'allow_other' FUSE library version: 2.8.4 nullpath_ok: 0 unique: 1, opcode: INIT (26), nodeid: 0, insize: 56 INIT: 7.16 flags=0x0000007b max_readahead=0x00020000 INIT: 7.12 flags=0x00000010 max_readahead=0x00020000 max_write=0x00020000 unique: 1, success, outsize: 40 unique: 2, opcode: LOOKUP (1), nodeid: 1, insize: 44 LOOKUP /bla getattr /bla NODEID: 2 unique: 2, success, outsize: 144 unique: 3, opcode: OPEN (14), nodeid: 2, insize: 48 open flags: 0x8000 /bla open[0] flags: 0x8000 /bla unique: 3, success, outsize: 32 unique: 4, opcode: READ (15), nodeid: 2, insize: 80 read[0] 4096 bytes from 0 flags: 0x8000 read[0] 3 bytes from 0 unique: 4, success, outsize: 19 unique: 5, opcode: FLUSH (25), nodeid: 2, insize: 64 flush[0] unique: 5, success, outsize: 16 unique: 6, opcode: RELEASE (18), nodeid: 2, insize: 64 unique: 6, success, outsize: 16 unique: 7, opcode: STATFS (17), nodeid: 1, insize: 40 unique: 7, success, outsize: 96 unique: 8, opcode: GETATTR (3), nodeid: 1, insize: 56 getattr / unique: 8, success, outsize: 120 unique: 9, opcode: STATFS (17), nodeid: 1, insize: 40 unique: 9, success, outsize: 96 #!/usr/bin/perl -w use strict; use warnings; use POSIX; use Fuse; my $mountpoint = shift; Fuse::main( mountpoint => $mountpoint, debug => 1, getdir =>\&getdir, getattr => \&getattr, read => \&read, open => \&open, flush => \&flush, ); sub open { return 0; } sub flush { return 0; } sub read { my ($filename, $bufflen, $offset) = @_; return "ABC"; } sub getdir { my ($filename) = @_; return ("bla", "."); } sub getattr { my ($filename) = @_; my $mode; if($filename eq "/") { $mode = 0040 << 9 | 0755; # dir }else{ $mode = 0100 << 9 | 0755; # file } my $nlink = 1; my $uid = $<; my ($gid) = split / /, $(; my $size = 0; my $rdev = 0; my $atime = time; my $mtime = $atime; my $ctime = $atime; my $blksize = 1024; my $blocks = 1; my $dev = 0; my $ino = 0; return ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks); } |