From bb21cf6f0e7aa5df2ba7a8cea81700f69905ac46 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 7 Sep 2016 19:49:42 +0100 Subject: [PATCH] local: ignore directory based junction points on windows These are a kind of symlink and rclone doesn't follow symlinks. Fixes #692 --- local/local.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/local/local.go b/local/local.go index 53da8f518..2aad80574 100644 --- a/local/local.go +++ b/local/local.go @@ -174,7 +174,9 @@ func (f *Fs) list(out fs.ListOpts, remote string, dirpath string, level int) (su newRemote := path.Join(remote, name) newPath := filepath.Join(dirpath, name) if fi.IsDir() { - if out.IncludeDirectory(newRemote) { + // Ignore directories which are symlinks. These are junction points under windows which + // are kind of a souped up symlink. Unix doesn't have directories which are symlinks. + if (fi.Mode()&os.ModeSymlink) == 0 && out.IncludeDirectory(newRemote) { dir := &fs.Dir{ Name: f.cleanRemote(newRemote), When: fi.ModTime(),