Giter VIP home page Giter VIP logo

cgofuse's Introduction

Cross-platform FUSE library for Go

Cgofuse is a cross-platform FUSE library for Go. It is supported on multiple platforms and can be ported to any platform that has a FUSE implementation. It has cgo and !cgo ("nocgo") variants depending on the platform.

Windows
macOS
Linux
FreeBSD
no CI
NetBSD*
no CI
OpenBSD*
no CI
cgo
!cgo

* NetBSD and OpenBSD support is experimental. There are known issues that stem from the differences in the NetBSD librefuse and OpenBSD libfuse implementations from the reference libfuse implementation

How to build

Windows cgo

  • Prerequisites: WinFsp, gcc (e.g. from Mingw-builds)
  • Build:
    > cd cgofuse
    > set CPATH=C:\Program Files (x86)\WinFsp\inc\fuse
    > go install -v ./fuse ./examples/memfs
    

Windows !cgo

  • Prerequisites: WinFsp
  • Build:
    > cd cgofuse
    > set CGO_ENABLED=0
    > go install -v ./fuse ./examples/memfs
    

macOS

Linux

  • Prerequisites: libfuse-dev, gcc
  • Build:
    $ cd cgofuse
    $ go install -v ./fuse ./examples/memfs ./examples/passthrough
    

FreeBSD

  • Prerequisites: fusefs-libs
  • Build:
    $ cd cgofuse
    $ go install -v ./fuse ./examples/memfs ./examples/passthrough
    
    # You may also need the following in order to run FUSE file systems.
    # Commands must be run as root.
    $ vi /boot/loader.conf                      # add: fuse_load="YES"
    $ sysctl vfs.usermount=1                    # allow user mounts
    $ pw usermod USERNAME -G operator           # allow user to open /dev/fuse
    

NetBSD

  • Prerequisites: NONE
  • Build:
    $ cd cgofuse
    $ go install -v ./fuse ./examples/memfs ./examples/passthrough
    
    # You may also need the following in order to run FUSE file systems.
    # Commands must be run as root.
    $ chmod go+rw /dev/puffs
    $ sysctl -w vfs.generic.usermount=1
    

OpenBSD

  • Prerequisites: NONE
  • Build:
    $ cd cgofuse
    $ go install -v ./fuse ./examples/memfs ./examples/passthrough
    
  • NOTE: OpenBSD 6 removed the kern.usermount option, which allowed non-root users to mount file systems [link]. Therefore you must be root in order to use FUSE and cgofuse.

How to use

User mode file systems are expected to implement fuse.FileSystemInterface. To make implementation simpler a file system can embed ("inherit") a fuse.FileSystemBase which provides default implementations for all operations. To mount a file system one must instantiate a fuse.FileSystemHost using fuse.NewFileSystemHost.

The full documentation is available at GoDoc.org: package fuse

There are currently three example file systems:

  • Hellofs is an extremely simple file system. Runs on all OS'es.
  • Memfs is an in memory file system. Runs on all OS'es.
  • Passthrough is a file system that passes all operations to the underlying file system. Runs on all OS'es except Windows.
  • Notifyfs is a file system that can issue file change notifications. Runs on Windows only.

How it is tested

The following software is being used to test cgofuse.

Windows (cgo and !cgo)

macOS

Linux

FreeBSD

Contributors

  • Bill Zissimopoulos <billziss at navimatics.com>
  • Nick Craig-Wood <nick at craig-wood.com>
  • Fredrik Medley <fredrik.medley at veoneer.com>

cgofuse's People

Contributors

billziss-gh avatar ncw avatar sometimesfood avatar

Watchers

 avatar

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.