示例#1
0
文件: tag.go 项目: hugelgupf/ninep
func (tag *Tag) Stat(fid *Fid) error {
	req := tag.reqAlloc()
	req.fid = fid
	err := ninep.PackTstat(req.Tc, fid.Fid)
	if err != nil {
		return err
	}

	return tag.clnt.Rpcnb(req)
}
示例#2
0
文件: stat.go 项目: hugelgupf/ninep
// Returns the metadata for the file associated with the Fid, or an Error.
func (clnt *Clnt) Stat(fid *Fid) (*ninep.Dir, error) {
	tc := clnt.NewFcall()
	err := ninep.PackTstat(tc, fid.Fid)
	if err != nil {
		return nil, err
	}

	rc, err := clnt.Rpc(tc)
	if err != nil {
		return nil, err
	}

	return &rc.Dir, nil
}