Coder Social home page Coder Social logo

sebastianscatularo / fuse-jna Goto Github PK

View Code? Open in Web Editor NEW

This project forked from etienneperot/fuse-jna

0.0 2.0 0.0 2.32 MB

No-nonsense, actually-working Java bindings to FUSE using JNA.

Home Page: http://fusejna.net/

License: Other

Shell 0.08% C 0.28% Groovy 1.27% Java 98.38%

fuse-jna's Introduction

Build Status

The straight dope

Grab it

git clone git://github.com/EtiennePerot/fuse-jna.git

Run it

fuse-jna/examples/hellofs.sh ~/hellofs

You now have a test filesystem in ~/hellofs. You'll find a file called hello.txt in there.

There's another example filesystem that you can use, which is writable:

fuse-jna/examples/memoryfs.sh ~/memoryfs

Make your own filesystem

  1. Subclass net.fusejna.FuseFilesystem and override the methods you need (For convenience, there is an adapter called FuseFilesystemAdapterFull).

  2. Create an instance of your subclass, then call .mount(mountpoint) on it.

  3. The filesystem will be unmounted automatically at JVM shutdown time if possible. You can unmount it at runtime using .unmount().

  4. ???

  5. Profit.

  6. (Bonus) You can get logging for free by calling .log(true) or .log(myLogger) on the filesystem instance.

The longer stuff

The idea

fuse-jna was born out of the desire for no-compilation-required, no-bullshit, actually-working bindings to the FUSE library.

Originally built to make the OS X/Linux port of SrcDemo² possible, it was separated into its own library because I figured others would benefit from it.

I like Python, and I like using fuse.py when writing FUSE filesystems in Python. Thanks to ctypes, it comes in just one file and that's all you need for nice 'n' straight Python bindings. The goal of fuse-jna is to bring FUSE bindings to Java with the same simplicity.

To do that, it uses JNA, which itself was inspired by Python's ctypes in terms of ease-of-use.

"Help! It's too slow!"

First and foremost, this library uses JNA for bindings, rather than JNI. Do not expect native performance. If you need native performance, look elsewhere.

This being said, you can greatly increase throughput by preventing FUSE from chunking writes in tiny blocks, tweaking some JVM parameters, etc. See issue 31 for details.

Other fuse libraries have popped up that use JNR instead of JNA. You might want to use them instead: javafs, jnr-fuse.

Compatibility

Following fuse.py, fuse-jna should work with:

  • OS X with MacFUSE/fuse4x/OSXFUSE on Intel architectures
  • Linux with FUSE on Intel, ARM, and PowerPC architectures
  • FreeBSD with FUSE on Intel architectures

Projects using fuse-jna

Feel free to open an issue to get your project added here.

Licensing

fuse-jna is licensed under the BSD 2-Clause License. JNA is licensed under the LGPL v2.1.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.