Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

vfs: fix errors when using > 260 char files in the cache in Windows

Nick Craig-Wood28255f1bacb2
diff --git a/vfs/vfscache/cache.go b/vfs/vfscache/cache.go
index d1a1e1d36..3d1f18021 100644
--- a/vfs/vfscache/cache.go
+++ b/vfs/vfscache/cache.go
@@ -20,6 +20,7 @@ import (
"github.com/rclone/rclone/fs/hash"
"github.com/rclone/rclone/fs/log"
"github.com/rclone/rclone/fs/operations"
+ "github.com/rclone/rclone/lib/file"
"github.com/rclone/rclone/vfs/vfscommon"
)
@@ -60,9 +61,9 @@ func New(ctx context.Context, fremote fs.Fs, opt *vfscommon.Options) (*Cache, er
}
fRoot = strings.Replace(fRoot, ":", "", -1)
}
- root := filepath.Join(config.CacheDir, "vfs", fremote.Name(), fRoot)
+ root := file.UNCPath(filepath.Join(config.CacheDir, "vfs", fremote.Name(), fRoot))
fs.Debugf(nil, "vfs cache root is %q", root)
- metaRoot := filepath.Join(config.CacheDir, "vfsMeta", fremote.Name(), fRoot)
+ metaRoot := file.UNCPath(filepath.Join(config.CacheDir, "vfsMeta", fremote.Name(), fRoot))
fs.Debugf(nil, "vfs metadata cache root is %q", root)
fcache, err := fscache.Get(root)