From 3e43ff7414b73f0d567da059ad6b86b793a2a538 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 7 Sep 2016 20:23:10 +0100 Subject: [PATCH] local: windows - ignore the symlink bit on files This allows files with reparse points to be backed up. Fixes #614 --- local/local.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/local/local.go b/local/local.go index 2aad80574..231f4965e 100644 --- a/local/local.go +++ b/local/local.go @@ -540,6 +540,11 @@ func (o *Object) SetModTime(modTime time.Time) error { // Storable returns a boolean showing if this object is storable func (o *Object) Storable() bool { mode := o.info.Mode() + // On windows a file with os.ModeSymlink represents a file with reparse points + if runtime.GOOS == "windows" && (mode&os.ModeSymlink) != 0 { + fs.Debug(o, "Clearing symlink bit to allow a file with reparse points to be copied") + mode &^= os.ModeSymlink + } if mode&(os.ModeSymlink|os.ModeNamedPipe|os.ModeSocket|os.ModeDevice) != 0 { fs.Debug(o, "Can't transfer non file/directory") return false