Skip to content

Latest commit

 

History

History
69 lines (48 loc) · 1.36 KB

README.md

File metadata and controls

69 lines (48 loc) · 1.36 KB

Simple FUSE bindings for Go fs.FS

Build Status Go Reference license

This library is just a wrapper to easily mount fs.FS as a filesystem.

Dependencies:

Usage

Setup FUSE

Windows:

winget install dokan-dev.Dokany

Linux(Ubuntu)

apt install fuse

examples/simple/simple.go

package main

import (
	"os"
	"github.com/binzume/fsmount"
)

func main() {
	mount, _ := fsmount.MountFS("X:", os.DirFS("."), nil)
	defer mount.Close()

	// Block forever
	select {}
}

How to create a writable FS?

See examples/writable/writable.go

go run ./examples/writable testdir R:
type WritableFS interface {
	fs.FS
	OpenWriter(name string, flag int) (io.WriteCloser, error)
	Truncate(name string, size int64) error
}

Other interfaces such as RemoveFS, MkdirFS, RenameFS... are also available.

License

MIT