// Acknowledge release of file handle by kernel func (sc *serveConn) release(req *fuse.ReleaseRequest) { sc.Lock() defer sc.Unlock() h := sc.handles[req.Handle] if h.writer != nil { h.writer.Close() /* fileId, err := sc.db.FileIdForInode(uint64(h.inode)) if err != nil { log.Printf("failed to lookup inode for close: %v\n", err) req.RespondError(fuse.EIO) return } l := &drive.FileLabels{Hidden: false} f := drive.File{Id: fileId, Labels: l} if _, err = sc.service.Files.Update(fileId, &f).Do(); err != nil { log.Printf("failed to mark inode %v not hidden: %v\n", h.inode, err) req.RespondError(fuse.EIO) return } */ } h.inode = 0 req.Respond() }
func (o openFileHandle) Release(request *fuse.ReleaseRequest, intr fs.Intr) fuse.Error { log.Printf("Request: %+v\nObject: %+v\n", request, o) if o.parent.openHandles[o.name].handleNum == 1 { o.parent.RemoveHandle(o.name) } else { o.parent.openHandles[o.name].handleNum-- } request.Respond() return nil //fuse.ENOENT }
func (f *fs) handleRelease(r *fuse.ReleaseRequest) { log.Println("Inside handleRelease") f.handles.removeFileHandle(r.Handle) r.Respond() }