From eab55ce8829d0465eb421eaa79d31a566a0012ab Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 18 Nov 2017 11:53:22 +0000 Subject: [PATCH] vfs: add open files to directories --- vfs/read_write.go | 1 + vfs/write.go | 1 + 2 files changed, 2 insertions(+) diff --git a/vfs/read_write.go b/vfs/read_write.go index b8a0f2bab..b42d4f36e 100644 --- a/vfs/read_write.go +++ b/vfs/read_write.go @@ -104,6 +104,7 @@ func (fh *RWFileHandle) openPending(truncate bool) (err error) { fh.File = fd fh.opened = true fh.d.vfs.cache.open(fh.osPath) + fh.d.addObject(fh.file) // make sure the directory has this object in it now return nil } diff --git a/vfs/write.go b/vfs/write.go index b7de11ae2..ce9d6b914 100644 --- a/vfs/write.go +++ b/vfs/write.go @@ -51,6 +51,7 @@ func newWriteFileHandle(d *Dir, f *File, remote string) (*WriteFileHandle, error }() fh.file.addWriter(fh) fh.file.setSize(0) + d.addObject(fh.file) // make sure the directory has this object in it now return fh, nil }