Ejemplo n.º 1
0
func (tag *Tag) Remove(fid *Fid) error {
	req := tag.reqAlloc()
	req.fid = fid
	err := ninep.PackTremove(req.Tc, fid.Fid)
	if err != nil {
		return err
	}

	return tag.clnt.Rpcnb(req)
}
Ejemplo n.º 2
0
// Removes the file associated with the Fid. Returns nil if the
// operation is successful.
func (clnt *Clnt) Remove(fid *Fid) error {
	tc := clnt.NewFcall()
	err := ninep.PackTremove(tc, fid.Fid)
	if err != nil {
		return err
	}

	_, err = clnt.Rpc(tc)
	clnt.fidpool.putId(fid.Fid)
	fid.Fid = ninep.NOFID

	return err
}