commit b175e1b42adde278c3b6d86cfe69f3a09cac11fc
parent c54bd7bd95c5e307ea841e1ad305380fadbacee6
Author: Matsuda Kenji <info@mtkn.jp>
Date: Sun, 10 Sep 2023 16:20:02 +0900
delete unused items
Diffstat:
2 files changed, 2 insertions(+), 21 deletions(-)
diff --git a/file.go b/file.go
@@ -1,7 +1,6 @@
package lib9p
type File interface {
- Fsys() FS // The File System this file belongs to
Parent() (File, error) // Parent Directory
Child() ([]File, error) // Children
diff --git a/fs.go b/fs.go
@@ -3,32 +3,14 @@ package lib9p
import (
"fmt"
"io/fs"
- "path"
)
type FS interface {
Open(string) (File, error)
}
-func walk(fsys FS, root string, wnames []string) ([]Qid, error) {
- wqids := make([]Qid, len(wnames))
- curName := root
- for i, name := range wnames {
- curName = path.Join(curName, name)
- f, err := fsys.Open(curName)
- if err != nil {
- return wqids, err
- }
- fi, err := f.Stat()
- if err != nil {
- return wqids, err
- }
- qid := fi.Qid()
- wqids[i] = qid
- }
- return wqids, nil
-}
-
+// Walkfile walks file tree starting at f, following path specified by name.
+// It returns the destination file and nil, or nil with non-nil error.
func walkfile(f File, name string) (File, error) {
children, err := f.Child()
if err != nil {