Skip to content
프로젝트

소개

Go용 크로스 플랫폼 FUSE 라이브러리로, Windows, macOS, Linux, FreeBSD, NetBSD, OpenBSD에서 작동합니다.

개발 도구

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
0
in 7 days
0
in 15 days
+1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

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, !cgo (aka "nocgo") and FUSE (aka "FUSE2"), FUSE3 variants depending on the platform.

cgo !cgo FUSE FUSE3
Windows ✓ ✓ ✓
macOS ✓ ✓
Linux ✓ ✓ ✓
FreeBSD ✓ ✓ ✓
NetBSD ✓ ✓
OpenBSD ✓ ✓

How to build

Windows

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

macOS

Linux

  • Prerequisites: libfuse-dev, libfuse3-dev, gcc
  • Build FUSE:
    $ go install -v ./fuse ./examples/memfs ./examples/passthrough
    
  • Build FUSE3:
    $ go install -tags=fuse3 -v ./fuse ./examples/memfs ./examples/passthrough
    

FreeBSD

  • Prerequisites: fusefs-libs, fusefs-libs3
  • Build FUSE:
    $ go install -v ./fuse ./examples/memfs ./examples/passthrough
    
  • Build FUSE3:
    $ go install -tags=fuse3 -v ./fuse ./examples/memfs ./examples/passthrough
    
  • Note: You may also need the following in order to run FUSE file system. 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:
    $ go install -v ./fuse ./examples/memfs ./examples/passthrough
    
  • Note: 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
    
  • Note: Support is experimental. There are known issues that stem from the differences in the NetBSD librefuse implementation from the reference libfuse implementation.

OpenBSD

  • Prerequisites: NONE
  • Build:
    $ 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.
  • Note: Support is experimental. There are known issues that stem from the differences in the OpenBSD libfuse implementation from the reference libfuse implementation.

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

관련 프로젝트 살펴보기

불러오는 중…