Writing a FUSE filesystem in Python
stavros.io
stavros.io
Ctypes is the way to go for interacting with libfuse. Even better would be speaking the FUSE protocol directly to /dev/fuse*, but is rather complicated by our Windows support.
I have found Dokan (http://dokan-dev.net/en/) and pyFilesystem (http://pythonhosted.org/fs/expose.html) has a clever binding there you write your fs once and can mount it with FUSE or Dokan.
Is there something better?
I looked at it some years ago, but couldn't justify the cost for what I needed a FUSE like ability for. And moved on to a couple of other things.
The underlying mechanisms for FUSE are pretty convoluted and difficult, so much more than trivial examples can break the abstractions afforded by the libraries like the one used in the post.
V9FS is in contrast exceedingly simple and basically unchanged. And, yes, it's based on the Plan 9 filesystem protocols :)
FUSE is too complicated to directly interact with, so everyone (OP included) is using libraries and abstractions on top of it. So what you'd really be comparing is that abstraction, as well as possibly how it limits actual FUSE interaction. Additionally, the performance of these abstractions is hard to predict, as many do lots of work (threads/IPC/etc) silently in the background, so the apparent workload on your filesystem driver is far from actual workload.
V9FS is simple enough that drivers often just talk it directly. The protocol is a simple RPC mechanism, and parallelism happens naturally.
As far as a direct comparison example, I don't know of one.
It's a great way to do FS-like things ("edit X in vim", "run aspell across all keys in Y") on very non-file-like objects.
Some of the ideas are available in Plan 9 from User Space.
https://gist.github.com/BHSPitMonkey/01cef0d528f374cca8cb#fi...
https://forge.gluster.org/glupy
This allows you to add your own functionality alongside everything GlusterFS already has - e.g. distribution, replication, handling for all sorts of annoying VFS/POSIX special cases - instead of having to do everything from scratch yourself. I'm not saying it's the right option for everyone who might just use FUSE directly, but it might be an option to consider.
Disclaimer: I'm the original author, though others have taken over since.
http://blogs.perl.org/users/fuzzix/2012/08/fun-with-fuse.htm...
The info should transfer to other FUSE bindings.
> This is a very early version. Therefore it will most probably not work for you, but we don't know why. It is also missing some probably-critical features.
My data is worth more to me than that. However, based on the description it sounds like a more complex version of rsnapshot. rsnapshot uses rsync as the underlying protocol, and uses standard hardlinks instead of packfiles for deduplication. The nice result is that you do not need any FUSE plugin to browse full backups: they are simply stored on your normal filesystem.
I did not look at how bup is configured, but will say that from the "set it and forget it" perspective, rsnapshot is very well made: a single declarative config file will suffice to back up all your servers.