Filesystem example in pure fuse
authorHarvie <tomas@mudrunka.cz>
Thu, 24 May 2012 00:02:24 +0000 (02:02 +0200)
committerHarvie <tomas@mudrunka.cz>
Thu, 24 May 2012 00:02:24 +0000 (02:02 +0200)
perl/fuse/fs3.pl [new file with mode: 0755]

diff --git a/perl/fuse/fs3.pl b/perl/fuse/fs3.pl
new file mode 100755 (executable)
index 0000000..e9a1f28
--- /dev/null
@@ -0,0 +1,25 @@
+#!/usr/bin/env perl
+
+use Fuse;
+
+#use JSON;
+#print encode_json {};
+
+my ($mountpoint) = "";
+$mountpoint = shift(@ARGV) if @ARGV;
+Fuse::main(mountpoint=>$mountpoint, getattr=>"main::my_getattr", getdir=>"main::my_getdir");
+
+sub my_getattr {
+       #($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks)
+       #return (1,1,0777,1,0,0,1,1,1,1,1,1,1);
+       my ($size) = 1024;
+       my ($modes) = (0040<<9) + 0755; #dir=0040, file=0100
+       my ($dev, $ino, $rdev, $blocks, $gid, $uid, $nlink, $blksize) = (0,0,0,1,0,0,1,1024);
+       my ($atime, $ctime, $mtime);
+       $atime = $ctime = $mtime = 666666;
+       return ($dev,$ino,$modes,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks);
+}
+
+sub my_getdir {
+       return ('.', 'a', 'b', 0);
+}
This page took 0.140641 seconds and 4 git commands to generate.