From 30783ce79c81a02e3d8eef22c7264f42e08a8cb6 Mon Sep 17 00:00:00 2001 From: Zack Scholl Date: Fri, 5 Mar 2021 09:00:15 -0800 Subject: [PATCH] overwrite symlinks on transfer, like files, fixes #334 --- src/croc/croc.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/croc/croc.go b/src/croc/croc.go index c556582..478c9b6 100644 --- a/src/croc/croc.go +++ b/src/croc/croc.go @@ -1164,6 +1164,10 @@ func (c *Client) createEmptyFileAndFinish(fileInfo FileInfo, i int) (err error) pathToFile := path.Join(fileInfo.FolderRemote, fileInfo.Name) if fileInfo.Symlink != "" { log.Debug("creating symlink") + // remove symlink if it exists + if _, errExists := os.Lstat(pathToFile); errExists == nil { + os.Remove(pathToFile) + } err = os.Symlink(fileInfo.Symlink, pathToFile) if err != nil { return