Exemple #1
0
func (sfs *NopSrv) Attach(req *go9p.SrvReq) {
	if req.Afid != nil {
		req.RespondError(go9p.Enoauth)
		return
	}

	req.Fid.Aux = sfs.Root
	if sfs.Debuglevel > 0 {
		log.Printf("attach")
	}

	req.RespondRattach(Qid(sfs.Root))
}
Exemple #2
0
Fichier : p9.go Projet : flynn/bake
// Attach creates a file handle on the file system.
func (fs *fileSystem) Attach(req *go9p.SrvReq) {
	rootID, filename := split(req.Tc.Aname)
	aux := &Aux{
		rootID: rootID,
		path:   path.Join(fs.path, filename),
	}
	req.Fid.Aux = aux

	if err := aux.stat(); err != nil {
		req.RespondError(err)
		return
	}

	req.RespondRattach(aux.qid())
}