aboutsummaryrefslogtreecommitdiff
path: root/internal/fusefrontend_reverse/rfile.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/fusefrontend_reverse/rfile.go')
-rw-r--r--internal/fusefrontend_reverse/rfile.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/internal/fusefrontend_reverse/rfile.go b/internal/fusefrontend_reverse/rfile.go
new file mode 100644
index 0000000..746a0d6
--- /dev/null
+++ b/internal/fusefrontend_reverse/rfile.go
@@ -0,0 +1,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
+}