Skip to content

Instantly share code, notes, and snippets.

@zackmdavis
Created February 26, 2016 19:38
Show Gist options
  • Save zackmdavis/6de3267f371a3dbb788d to your computer and use it in GitHub Desktop.
Save zackmdavis/6de3267f371a3dbb788d to your computer and use it in GitHub Desktop.
break
}
panic(err)
}
log.Printf("request is %#+v", req)
switch req := req.(type) {
case *fuse.StatfsRequest:
stats, err := mountHandle.Statfs()
if err != nil {
panic(err)
}
resp := &fuse.StatfsResponse{
Files: stats[fs.StatFSNumFiles],
// some fake values for illustration in `df -a` output
Blocks: 100000,
Bfree: 10000,
Bavail: 10000,
Bsize: 100000,
Namelen: 256,
Frsize: 100000,
}
req.Respond(resp)
case *fuse.LookupRequest:
// mounHandle.LookupPath
case *fuse.ReadRequest:
// InodeHandle.{Read, Readdir}
case *fuse.GetattrRequest:
// ???
default:
req.RespondError(fuse.ENOSYS)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment