Commit c5ba5de9 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

example/multizip: use new nodefs package.

parent bfaeb760
...@@ -9,9 +9,9 @@ import ( ...@@ -9,9 +9,9 @@ import (
"fmt" "fmt"
"os" "os"
"path/filepath" "path/filepath"
"time"
"github.com/hanwen/go-fuse/fuse/nodefs" "github.com/hanwen/go-fuse/nodefs"
"github.com/hanwen/go-fuse/fuse/pathfs"
"github.com/hanwen/go-fuse/zipfs" "github.com/hanwen/go-fuse/zipfs"
) )
...@@ -25,15 +25,19 @@ func main() { ...@@ -25,15 +25,19 @@ func main() {
os.Exit(2) os.Exit(2)
} }
fs := zipfs.NewMultiZipFs() fs := &zipfs.MultiZipFs{}
nfs := pathfs.NewPathNodeFs(fs, nil) sec := time.Second
opts := nodefs.NewOptions() opts := nodefs.Options{
EntryTimeout: &sec,
AttrTimeout: &sec,
DefaultPermissions: true,
}
opts.Debug = *debug opts.Debug = *debug
state, _, err := nodefs.MountRoot(flag.Arg(0), nfs.Root(), opts) server, err := nodefs.Mount(flag.Arg(0), fs, &opts)
if err != nil { if err != nil {
fmt.Printf("Mount fail: %v\n", err) fmt.Printf("Mount fail: %v\n", err)
os.Exit(1) os.Exit(1)
} }
state.Serve() server.Serve()
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment