summaryrefslogtreecommitdiff
path: root/internal/fusefrontend_reverse/rfile.go
blob: 746a0d6d283ab64f6fee75e2916585864b72c353 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package fusefrontend_reverse

import (
	"os"

	"github.com/hanwen/go-fuse/fuse"
	"github.com/hanwen/go-fuse/fuse/nodefs"

	"github.com/rfjakob/gocryptfs/internal/contentenc"
)

type file struct {
	fd *os.File
	// Content encryption helper
	contentEnc *contentenc.ContentEnc

	// nodefs.defaultFile returns ENOSYS for all operations
	nodefs.File
}

func NewFile(fd *os.File, contentEnc *contentenc.ContentEnc) (nodefs.File, fuse.Status) {
	return &file{
		fd:         fd,
		contentEnc: contentEnc,
		File:       nodefs.NewDefaultFile(),
	}, fuse.OK
}