local: ignore directory based junction points on windows

These are a kind of symlink and rclone doesn't follow symlinks.

Fixes #692
This commit is contained in:
Nick Craig-Wood 2016-09-07 19:49:42 +01:00
parent bfe6f299d0
commit bb21cf6f0e
1 changed files with 3 additions and 1 deletions

View File

@ -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(),