Hello CandyAngel,

First of all sorry for the late reply I got busy with something else and I just found a few hours to spend with this script.

I am afraid that I can not be much of assistance with your problem. No matter what I tried I was not able to make my sample script to work.

I keep getting this error:

unique: 71, opcode: RELEASEDIR (29), nodeid: 1, insize: 64, pid: 0 unique: 71, success, outsize: 16 unique: 72, opcode: LOOKUP (1), nodeid: 1, insize: 52, pid: 26177 LOOKUP /autorun.inf unique: 72, error: -38 (Function not implemented), outsize: 16

Where it gets stack, for some unknown reason to me. I tried anything that could come to my mind but so far I did not find a solution to this problem.

But I found some example codes, that might give a few ideas to experiment with or play around with your code. Take a look here dpavlin/perl-fuse if you have not done it yet.

This is a sample of my code that I was trying to make it work, just in case that can help you by any means.

#!/usr/bin/perl use Fuse; use strict; use warnings; use threads::shared; use Fuse "fuse_get_context"; use POSIX "ENOENT"; my (%files) = ( 'thanos' => { type => 0040, mode => 0755, ctime => time()-1000 } ); sub filename_fixup { my ($file) = shift; $file =~ s,^/,,; $file = '.' unless length($file); return $file; } sub e_getattr { my ($file) = filename_fixup(shift); $file =~ s,^/,,; $file = '.' unless length($file); return -ENOENT() unless exists($files{$file}); my ($size) = exists($files{$file}{cont}) ? length($files{$file}{co +nt}) : 0; $size = $files{$file}{size} if exists $files{$file}{size}; my ($modes) = ($files{$file}{type}<<9) + $files{$file}{mode}; my ($dev, $ino, $rdev, $blocks, $gid, $uid, $nlink, $blksize) = (0 +,0,0,1,0,0,1,1024); my ($atime, $ctime, $mtime); $atime = $ctime = $mtime = $files{$file}{ctime}; # 2 possible types of return values: #return -ENOENT(); # or any other error you care to #print(join(",",($dev,$ino,$modes,$nlink,$uid,$gid,$rdev,$size,$at +ime,$mtime,$ctime,$blksize,$blocks)),"\n"); return ($dev,$ino,$modes,$nlink,$uid,$gid,$rdev,$size,$atime,$mtim +e,$ctime,$blksize,$blocks); } sub e_getdir { # return as many text filenames as you like, followed by the retva +l. print((scalar keys %files)."\n"); return (keys %files),0; } my $mountpoint = ""; $mountpoint = $ARGV[1] or die "You forgot to provide the mountpoint!\n +"; #$mountpoint = shift(@ARGV) if @ARGV; croak("Fuse doesn't have ioctl") unless Fuse::fuse_version() >= 2.8; Fuse::main( debug => 1, mountpoint => $mountpoint, mountopts => "", # if 'user_allow_other' in /etc/fuse.conf as per + the FUSE documention threaded => 0, getattr => "main::e_getattr", #getdir => "main::e_getdir", #open => "main::e_open", #statfs => "main::e_statfs", #read => "main::e_read", );

Just in case that you faced the same problem with me and you found a solution, let me know how you worked your way out of it. Any way, I hope by now you have solved your problems alternatively I am sure the examples will give you a few hints. Best of luck with your script.

Seeking for Perl wisdom...on the process of learning...not there...yet!

In reply to Re^3: FUSE, fuse_get_context and private = dangling pointer woes by thanos1983
in thread FUSE, fuse_get_context and private = dangling pointer woes by CandyAngel

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.