1
mirror of https://github.com/rclone/rclone synced 2024-11-26 04:07:22 +01:00

local: windows - ignore the symlink bit on files

This allows files with reparse points to be backed up.

Fixes #614
This commit is contained in:
Nick Craig-Wood 2016-09-07 20:23:10 +01:00
parent bb21cf6f0e
commit 3e43ff7414

View File

@ -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