From 7929b6e756ee04e03f3237509c65d8650154c323 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Mon, 28 Nov 2016 17:56:54 +0000 Subject: [PATCH] fuse: support R/W files only if truncate is set. Any reads on the file handle will return an error. This is to support windows/samba writes. --- cmd/mount/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/mount/file.go b/cmd/mount/file.go index e15283710..fb2f59f71 100644 --- a/cmd/mount/file.go +++ b/cmd/mount/file.go @@ -119,7 +119,7 @@ func (f *File) Open(ctx context.Context, req *fuse.OpenRequest, resp *fuse.OpenR resp.Flags |= fuse.OpenNonSeekable } return newReadFileHandle(o) - case req.Flags.IsWriteOnly(): + case req.Flags.IsWriteOnly() || (req.Flags.IsReadWrite() && (req.Flags&fuse.OpenTruncate) != 0): resp.Flags |= fuse.OpenNonSeekable src := newCreateInfo(f.d.f, o.Remote()) fh, err := newWriteFileHandle(f.d, f, src)