mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 09:11:11 +08:00
vfs: fix errors when using > 260 char files in the cache in Windows
This makes the cache use UNC paths on Windows. This stops the cache exploding when using > 260 character paths
This commit is contained in:
parent
917cb4acb3
commit
28255f1bac
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user