Skip to content

Commit

Permalink
vfs: add open files to directories
Browse files Browse the repository at this point in the history
  • Loading branch information
ncw committed Nov 20, 2017
1 parent 61b6159 commit eab55ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions vfs/read_write.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
1 change: 1 addition & 0 deletions vfs/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit eab55ce

Please sign in to comment.