9sh

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 12589fc26cadadc12e0553515826675575dd6142
parent 1e28aa20e5000ff073790d029240bec199f9fe6c
Author: Matsuda Kenji <info@mtkn.jp>
Date:   Thu,  9 Nov 2023 08:52:07 +0900

toriaezu ugoku

Diffstat:
Mgo.mod | 4++++
Ago.sum | 0
Amain.go | 32++++++++++++++++++++++++++++++++
3 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/go.mod b/go.mod @@ -1,3 +1,7 @@ module 9sh go 1.21.3 + +require git.mtkn.jp/lib9p v0.2.1 + +replace git.mtkn.jp/lib9p => ../lib9p diff --git a/go.sum b/go.sum diff --git a/main.go b/main.go @@ -0,0 +1,31 @@ +package main + +import ( + "fmt" + "io/fs" + "net" + "log" + + "git.mtkn.jp/lib9p" + "git.mtkn.jp/lib9p/client" +) + +func main() { + conn, err := net.Dial("tcp", "127.0.0.1:5640") + if err != nil { + log.Fatalf("dial: %v", err) + } + defer conn.Close() + fsys, err := client.Mount(conn, conn, "kenji", "") + if err != nil { + log.Fatalf("mount: %v", err) + } + walk := func(path string, d fs.DirEntry, err error) error { + fmt.Println(path) + if err != nil { + return err + } + return nil + } + fs.WalkDir(lib9p.ExportFS{fsys}, ".", walk) +} +\ No newline at end of file