lib
packagemoduleThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
README¶
GO-FUSE
Go native bindings for the FUSE kernel module.
You should import and usegithub.com/hanwen/go-fuse/fslibrary. It follows the wire protocol closely, but providesconvenient abstractions for building both node and path based filesystems
Older, deprecated APIs are available atgithub.com/hanwen/go-fuse/fuse/pathfsandgithub.com/hanwen/go-fuse/fuse/nodefs.
Comparison with other FUSE libraries
The FUSE library gained a new, cleaned-up API during a rewritecompleted in 2019. Find extensive documentationhere.
Further highlights of this library is
Comprehensive and up to date protocol support (up to 7.12.28).
Performance that is competitive with libfuse.
Examples
example/hello/main.gocontains a 60-line "hello world" filesystemzipfs/zipfs.gocontains a small and simple read-only filesystem forzip and tar files. The corresponding command is in example/zipfs/For example,mkdir /tmp/mountpointexample/zipfs/zipfs /tmp/mountpoint file.zip &ls /tmp/mountpointfusermount -u /tmp/mountpointzipfs/multizipfs.goshows how to use in-process mounts tocombine multiple Go-FUSE filesystems into a larger filesystem.fuse/loopback.gomounts another piece of the filesystem.Functionally, it is similar to a symlink. A binary to run is inexample/loopback/ . For examplemkdir /tmp/mountpointexample/loopback/loopback -debug /tmp/mountpoint /some/other/directory &ls /tmp/mountpointfusermount -u /tmp/mountpoint
macOS Support
go-fuse works somewhat on OSX. Known limitations:
All of the limitations of OSXFUSE, including lack of support forNOTIFY.
OSX issues STATFS calls continuously (leading to performanceconcerns).
OSX has trouble with concurrent reads from the FUSE device, leadingto performance concerns.
Tests are expected to pass; report any failure as a bug!
Credits
Inspired by Taru Karttunen's package,https://bitbucket.org/taruti/go-extra.
Originally based on Ivan Krasin'shttps://github.com/krasin/go-fuse-zip
Bugs
Yes, probably. Report them throughhttps://github.com/hanwen/go-fuse/issues
Disclaimer
This is not an official Google product.
Known Problems
Grep source code for TODO. Major topics:
- Missing support for
CUSE,BMAP,IOCTL
License
Like Go, this library is distributed under the new BSD license. Seeaccompanying LICENSE file.
Appendix I. Go-FUSE log format
To increase signal/noise ratio Go-FUSE uses abbreviations in its debug logoutput. Here is how to read it:
iXmeansinode X;gXmeansgeneration X;tAandtEmeans timeout for attributes and directory entry correspondingly;[<off> +<size>)means data range from<off>inclusive till<off>+<size>exclusive;XbmeansX bytes.
Every line is prefixed with eitherrx <unique> ortx <unique> to denotewhether it was for kernel request, which Go-FUSE received, or reply, whichGo-FUSE sent back to kernel.
Example debug log output:
rx 2: LOOKUP i1 [".wcfs"] 6btx 2: OK, {i3 g2 tE=1s tA=1s {M040755 SZ=0 L=0 1000:1000 B0*0 i0:3 A 0.000000 M 0.000000 C 0.000000}}rx 3: LOOKUP i3 ["zurl"] 5btx 3: OK, {i4 g3 tE=1s tA=1s {M0100644 SZ=33 L=1 1000:1000 B0*0 i0:4 A 0.000000 M 0.000000 C 0.000000}}rx 4: OPEN i4 {O_RDONLY,0x8000}tx 4: 38=function not implemented, {Fh 0 }rx 5: READ i4 {Fh 0 [0 +4096) L 0 RDONLY,0x8000}tx 5: OK, 33b data "file:///"...rx 6: GETATTR i4 {Fh 0}tx 6: OK, {tA=1s {M0100644 SZ=33 L=1 1000:1000 B0*0 i0:4 A 0.000000 M 0.000000 C 0.000000}}rx 7: FLUSH i4 {Fh 0}tx 7: OKrx 8: LOOKUP i1 ["head"] 5btx 8: OK, {i5 g4 tE=1s tA=1s {M040755 SZ=0 L=0 1000:1000 B0*0 i0:5 A 0.000000 M 0.000000 C 0.000000}}rx 9: LOOKUP i5 ["bigfile"] 8btx 9: OK, {i6 g5 tE=1s tA=1s {M040755 SZ=0 L=0 1000:1000 B0*0 i0:6 A 0.000000 M 0.000000 C 0.000000}}rx 10: FLUSH i4 {Fh 0}tx 10: OKrx 11: GETATTR i1 {Fh 0}tx 11: OK, {tA=1s {M040755 SZ=0 L=1 1000:1000 B0*0 i0:1 A 0.000000 M 0.000000 C 0.000000}}
Documentation¶
Overview¶
This is a repository containing Go bindings for writing FUSE filesystems.
Go tohttps://godoc.org/github.com/hanwen/go-fuse/fs for thein-depth documentation for this library.
Older, deprecated APIs are available athttps://godoc.org/github.com/hanwen/go-fuse/fuse/pathfs andhttps://godoc.org/github.com/hanwen/go-fuse/fuse/nodefs.
Directories¶
| Path | Synopsis |
|---|---|
bulkstatcommand | |
example | |
autounionfscommand | |
benchmark-read-throughputcommand readbench is a benchmark helper for measuring throughput on single-file reads out of a FUSE filesystem. | readbench is a benchmark helper for measuring throughput on single-file reads out of a FUSE filesystem. |
hellocommand This program is the analogon of libfuse's hello.c, a a program that exposes a single file "file.txt" in the root directory. | This program is the analogon of libfuse's hello.c, a a program that exposes a single file "file.txt" in the root directory. |
loopbackcommand This is main program driver for the loopback filesystem from github.com/hanwen/go-fuse/fs/, a filesystem that shunts operations to an underlying file system. | This is main program driver for the loopback filesystem from github.com/hanwen/go-fuse/fs/, a filesystem that shunts operations to an underlying file system. |
memfscommand | |
multizipcommand This is main program driver for MultiZipFs from github.com/hanwen/go-fuse/zipfs, a filesystem for mounting multiple read-only archives. | This is main program driver for MultiZipFs from github.com/hanwen/go-fuse/zipfs, a filesystem for mounting multiple read-only archives. |
statfscommand statfs is a main driver for the file system from github.com/hanwen/go-fuse/benchmark, intended for benchmarking FUSE libraries. | statfs is a main driver for the file system from github.com/hanwen/go-fuse/benchmark, intended for benchmarking FUSE libraries. |
unionfscommand | |
zipfscommand This is main program driver for github.com/hanwen/go-fuse/zipfs, a filesystem for mounting read-only archives. | This is main program driver for github.com/hanwen/go-fuse/zipfs, a filesystem for mounting read-only archives. |
Package fs provides infrastructure to build tree-organized filesystems. | Package fs provides infrastructure to build tree-organized filesystems. |
Package fuse provides APIs to implement filesystems in userspace in terms of raw FUSE protocol. | Package fuse provides APIs to implement filesystems in userspace in terms of raw FUSE protocol. |
nodefs This package is deprecated. | This package is deprecated. |
pathfs This package is deprecated. | This package is deprecated. |
test Package test holds the tests for Go-FUSE and is not for end-user consumption. | Package test holds the tests for Go-FUSE and is not for end-user consumption. |
Package posixtest file systems for generic posix conformance. | Package posixtest file systems for generic posix conformance. |