lib9p

Go 9P library.
Log | Files | Refs | LICENSE

commit a9cbb9c8ed9cdaaf64c34bdb13aabeab49b0a0eb
parent d958eeb2942a10f1c64e63bdd53778e5710cd2f9
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Sun, 14 Jan 2024 11:39:35 +0900

add comment about Qid.Path and path name

Diffstat:
Mserver.go | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/server.go b/server.go @@ -949,6 +949,12 @@ func sClunk(ctx context.Context, c *conn, rc <-chan *request) { } } +// sRemove serves Tremove messages. +// TODO: RemoverFS.Remove function takes as argument the file path to be +// removed. But in the protocol, files are identified by Qid.Path, not by +// path name from the root of the file system. +// But os package also uses the file path to remove an file. +// And the library should not care the inconsistency of Qid.Path? func sRemove(ctx context.Context, c *conn, rc <-chan *request) { for { select { @@ -987,7 +993,7 @@ func sRemove(ctx context.Context, c *conn, rc <-chan *request) { } // BUG: race. Remove call below uses r.fid.path, so I need to // check whether the underlying qid is the same. - // But other connection can move the same file and then create + // But other requests can move the same file and then create // new one with the same name. fi, err = fs.Stat(ExportFS{FS: r.fid.fs}, r.fid.path) if err != nil {