On Fri, 19 Feb 2010, Christopher Arnold wrote:
> Sorry for missing the subject in the first post.
>
> On Fri, 19 Feb 2010, Michael Raskin wrote:
>
>> On 02/19/2010 02:24 PM, Christopher Arnold wrote:
>>> Or is this a dead end? I is not possible to implement versioning in fuse?
>>>
>>> Or does anyone have anouter route to solve this?
>>
>> As far as I know, you can fill in some uint64 fh field in file_info and
>> use it to identify connections.
>>
>
> <doc>
> uint64_t fuse_file_info::fh
> File handle. May be filled in by filesystem in open(). Available in all
> other file operations
> </doc>
>
>
> Great, this is exactly what is needed to du my stuff.
>
>
> So i guess my problem boils down to the fact that this variable is not
> exposed in the perl bindings? Or am i wrong and just havn't found it?
>
And i still havn't found what i'm looking for. So i'm trying to modify
Fuse.xs to do what i want. Unfortunatly i have to little knowledge of the
innards of fuse and of binding C code and variables to a perl program. But
i'm trying to get some clue...
I belive the way forward is to modify _PLfuse_open in this way:
if(rv)
rv = POPi;
if(rv > 0) { fi->fh = rv ; rv = 0 ; }
else
rv = 0;
That is if open returns a positive value i set fi->fh and clear the return
value. Now if i underrstand things right the returned value should be
included in all future reads etc.
But could someone please give me a pointer to the following:
A) How do i get a pointer to the current fuse_file_info in for example a
read?
B) Does anyone have a nice evample of how to tie this value to a varable
(or function) accessible from within my perl code?
Or maybe someone has allready done something like this? I would love to
have a peek at the relevant code in that case. Or any other pointer on how
to publish a C variable to a perl module.
All input is welcome. Even if it is a "what the heck are you trying to
do?"...
/Chris
--
http://www.arnold.se
|