Skip to content

Instantly share code, notes, and snippets.

@tianon
Last active February 22, 2026 21:19
Show Gist options
  • Select an option

  • Save tianon/90f87be856d34a85a22267290cb43e4b to your computer and use it in GitHub Desktop.

Select an option

Save tianon/90f87be856d34a85a22267290cb43e4b to your computer and use it in GitHub Desktop.
targz fuse; gluing together my friends' libraries ("now kith")
module jon-fuse-johnson
go 1.26
require (
github.com/cpuguy83/go2fuse v0.0.0-20260222182647-239b980c16a9
github.com/hanwen/go-fuse/v2 v2.9.0
github.com/jonjohnsonjr/targz v0.0.0-20250908171716-7f45c9361279
)
require golang.org/x/sys v0.28.0 // indirect
github.com/cpuguy83/go2fuse v0.0.0-20260222182647-239b980c16a9 h1:RX9LPZXLVHW7+TxPlfzYKpO11E2i08JidBSDbMm3ZYc=
github.com/cpuguy83/go2fuse v0.0.0-20260222182647-239b980c16a9/go.mod h1:VL7EKrE+ApEKFk2oorZsY2GoPIcSydLibjqJ2Ax/ne4=
github.com/hanwen/go-fuse/v2 v2.9.0 h1:0AOGUkHtbOVeyGLr0tXupiid1Vg7QB7M6YUcdmVdC58=
github.com/hanwen/go-fuse/v2 v2.9.0/go.mod h1:yE6D2PqWwm3CbYRxFXV9xUd8Md5d6NG0WBs5spCswmI=
github.com/jonjohnsonjr/targz v0.0.0-20250908171716-7f45c9361279 h1:K+c7xw1y3Hf7KawbI0Nhh9jl7me43uey6HFBMjIk8uU=
github.com/jonjohnsonjr/targz v0.0.0-20250908171716-7f45c9361279/go.mod h1:vFsMbFCBsTclpEtIkbCOBAJj1mBsqoMtm22ibo1cG2o=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/moby/sys/mountinfo v0.7.2 h1:1shs6aH5s4o5H2zQLn796ADW1wMrIwHsyJ2v9KouLrg=
github.com/moby/sys/mountinfo v0.7.2/go.mod h1:1YOa8w8Ih7uW0wALDUgT1dTTSBrZ+HiBLGws92L2RU4=
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
package main
import (
"os"
"time"
"github.com/cpuguy83/go2fuse"
gofusefs "github.com/hanwen/go-fuse/v2/fs"
gofuse "github.com/hanwen/go-fuse/v2/fuse"
"github.com/jonjohnsonjr/targz/gsip"
"github.com/jonjohnsonjr/targz/tarfs"
)
func main() {
filename := os.Args[1]
mount := os.Args[2]
f, err := os.Open(filename)
if err != nil {
panic(err)
}
defer f.Close()
fi, err := f.Stat()
if err != nil {
panic(err)
}
sippy, err := gsip.NewReader(f, fi.Size())
if err != nil {
panic(err)
}
fs, err := tarfs.New(sippy, -1) // TODO should we specify a better size here instead?
if err != nil {
panic(err)
}
server, err := go2fuse.Mount(mount, fs, &gofusefs.Options{
MountOptions: gofuse.MountOptions{
FsName: "jon-fuse-johnson",
Name: "jon-fuse-johnson",
},
EntryTimeout: new(time.Second),
AttrTimeout: new(time.Second),
})
if err != nil {
panic(err)
}
server.Wait()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment