func (r *RufsReadResult) Bytes(buf []byte) ([]byte, fuse.Status) {
	return r.buf, fuse.OK
}
/*
Bytes returns the raw bytes for the read.
package export
import (
	"log"
	"os"
	"path"
	"path/filepath"
	"devt.de/krotik/rufs"
	"github.com/hanwen/go-fuse/v2/fuse"
	"github.com/hanwen/go-fuse/v2/fuse/nodefs"
	"github.com/hanwen/go-fuse/v2/fuse/pathfs"
)
type RufsFuse struct {
	pathfs.FileSystem
	Tree *rufs.Tree
}
func (rf *RufsFuse) GetAttr(name string, context *fuse.Context) (*fuse.Attr, fuse.Status) {
	if name == "" {
		return &fuse.Attr{
			Mode: fuse.S_IFDIR | 0755,
		}, fuse.OK
	}
	var a *fuse.Attr
	status := fuse.ENOENT
	name = path.Join("/", name)
	dir, file := filepath.Split(name)
	_, fis, err := rf.Tree.Dir(dir, "", false, false)
	if err != nil {
		log.Print(err)
		status = fuse.EIO
	}
	if len(fis) > 0 {
		for _, fi := range fis[0] {
			if fi.Name() == file {
				a = &fuse.Attr{
					Mode: OSModeToFuseMode(fi.Mode()),
					Size: uint64(fi.Size()),
				}
				status = fuse.OK
			}
		}
	}
	return a, status
}
func (rf *RufsFuse) OpenDir(name string,
	context *fuse.Context) ([]fuse.DirEntry, fuse.Status) {
	var c []fuse.DirEntry
	name = path.Join("/", name)
	status := fuse.ENOENT
	_, fis, err := rf.Tree.Dir(name, "", false, false)
	if err != nil {
		LogError(err)
		return nil, fuse.EIO
	}
	if len(fis) > 0 {
		for _, fi := range fis[0] {
			c = append(c, fuse.DirEntry{
				Name: fi.Name(),
				Mode: OSModeToFuseMode(fi.Mode()),
			})
		}
		status = fuse.OK
	}
	return c, status
}
func (rf *RufsFuse) Open(name string, flags uint32, context *fuse.Context) (file nodefs.File, code fuse.Status) {
	return &RufsFile{nodefs.NewDefaultFile(), path.Join("/", name), rf.Tree}, fuse.OK
}
type RufsFile struct {
	nodefs.File
	name string
	tree *rufs.Tree
}
func (f *RufsFile) Read(buf []byte, off int64) (fuse.ReadResult, fuse.Status) {
	var res fuse.ReadResult
	status := fuse.OK
	n, err := f.tree.ReadFile(f.name, buf, off)
	if err != nil {
		LogError(err)
		status = fuse.EIO
	} else {
		res = &RufsReadResult{buf, n}
	}
	return res, status
}
type RufsReadResult struct {
	buf []byte
	n   int
}