示例#1
0
文件: tag.go 项目: rjkroege/go9p
func (tag *Tag) Clunk(fid *Fid) error {
	req := tag.reqAlloc()
	req.fid = fid
	err := p.PackTclunk(req.Tc, fid.Fid)
	if err != nil {
		return err
	}

	return tag.clnt.Rpcnb(req)
}
示例#2
0
文件: close.go 项目: rjkroege/go9p
// Clunks a fid. Returns nil if successful.
func (clnt *Clnt) Clunk(fid *Fid) (err error) {
	err = nil
	if fid.walked {
		tc := clnt.NewFcall()
		err := p.PackTclunk(tc, fid.Fid)
		if err != nil {
			return err
		}

		_, err = clnt.Rpc(tc)
	}

	clnt.fidpool.putId(fid.Fid)
	fid.walked = false
	fid.Fid = p.NOFID
	return
}