From 871e6ca631f79aecdccd54d69fb2968d1e2a6e2c Mon Sep 17 00:00:00 2001 From: langj Date: Mon, 9 Oct 2023 21:01:46 +0200 Subject: [PATCH] fix path while prereading parent dir --- internal/pkg/cacheclient/cacheclient.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/pkg/cacheclient/cacheclient.go b/internal/pkg/cacheclient/cacheclient.go index a7db21c..c29cd19 100644 --- a/internal/pkg/cacheclient/cacheclient.go +++ b/internal/pkg/cacheclient/cacheclient.go @@ -5,6 +5,7 @@ import ( "github.com/hashicorp/golang-lru/v2/expirable" "github.com/rs/zerolog/log" "io/fs" + "path/filepath" "readnetfs/internal/pkg/fsclient" "sync" "syscall" @@ -109,7 +110,7 @@ func (c *CacheClient) FileInfo(path fsclient.RemotePath) (fs.FileInfo, error) { func() { c.dirContentLock.Lock() defer c.dirContentLock.Unlock() - infos, err := c.client.ReadDir(path) + infos, err := c.client.ReadDir(fsclient.RemotePath(filepath.Dir(string(path)))) if err != nil { return }