Here is fuse_lowlevel.h : http://gist.github.com/459470
On a tangential note, is anyone working on Node support for SWIG[1]?
You'd only need to write a single interface file, then SWIG will
generate the bindings for you. Something like the below is probably
all that is required to create a FUSE module.
%module fuse
%{
#include <fuse.h>
%}
%include <fuse.h>
Doesn't get much simpler than that, does it?
The next step is to basically set up a custom libeio loop, and move
over all the logic from the fuse_loop into that. The API I had in
mind was something like:
var fuse = require("fuse")
fuse.mount("/some/path",
{ "stat" : function (path, cb) { cb(error, stat object) }
, "open" : function (path, mode, cb ) { cb(error, fd) }
, "read" : ...
})
With perhaps some default dummy stuff in there so that un-handled
things return an error rather than a total segfault failure.
--i
On Mon, Jan 24, 2011 at 12:31, Tim Caswell <t...@creationix.com> wrote:
> Any update on this? I still think this would be super useful. I saw Isaac
> has an empty repo on github, but that was all I could find.
>
> --
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com.
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en.
>
You should be able to do it on the main loop. I've got code samples on
how to poll it from libev.
--
So, node's fs.open looks like: fs.open(path, flags, mode=0666, [callback])
and then the callback gets called with callback(err, fd), where err is
null or an error, and fd is the file descriptor, if it was opened
successfully.
In a node-fuse filesystem, the object you provide would (in order to
implement the "open" call) implement a method that looks like:
open(path, flags, mode=0666, [callback]) and then at some point
*calls* the callback argument (if provided) with either (err, fd).
You should be able to say "Reverse the arguments and function names
from the 'fs' lib to implement a filesystem", and then a fuse fs
object could look just like the fs module. In fact, you'd even be
able to pass the fs module *itself* into fuse.mount in order to mount
one file system onto another.
So that's why I imagined the cb's taking paths rather than inodes.
But if you wanna run with this ball for a while, by all means, take it
wherever you wanna go.
--i