From: Dobrica Pavlinusic Date: Mon, 2 Jan 2006 20:31:19 +0000 (+0000) Subject: added blib, create /tmp/fusetest-$ENV{LOGNAME} (from directory for loopback) if it... X-Git-Tag: 0.07_1~1 X-Git-Url: http://git.rot13.org/?p=perl-fuse.git;a=commitdiff_plain;h=b13e00c8412d4c6ce2ebe533cd7fac739087d2ce;ds=sidebyside added blib, create /tmp/fusetest-$ENV{LOGNAME} (from directory for loopback) if it doesn't exist. mounted directory will be empty when mounted. git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/fuse/perl-llin@23 6e4b0b00-1209-0410-87b2-b275959b5705 --- diff --git a/examples/loopback.pl b/examples/loopback.pl index dd3fe15..7a88876 100644 --- a/examples/loopback.pl +++ b/examples/loopback.pl @@ -1,13 +1,19 @@ #!/usr/bin/perl -w use strict; +use blib; use Fuse; use IO::File; use POSIX qw(ENOENT ENOSYS EEXIST EPERM O_RDONLY O_RDWR O_APPEND O_CREAT); use Fcntl qw(S_ISBLK S_ISCHR S_ISFIFO SEEK_SET); require 'syscall.ph'; # for SYS_mknod and SYS_lchown -sub fixup { return "/tmp/fusetest-" . $ENV{LOGNAME} . shift } +my $tmp_path = "/tmp/fusetest-" . $ENV{LOGNAME}; +if (! -e $tmp_path) { + mkdir($tmp_path) || die "can't create $tmp_path: $!"; +} + +sub fixup { return $tmp_path . shift } sub x_getattr { my ($file) = fixup(shift); @@ -133,4 +139,5 @@ Fuse::main( write =>"main::x_write", statfs =>"main::x_statfs", threaded=>0, + debug => 1, );