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 }