mirror of https://github.com/schollz/croc.git
overwrite symlinks on transfer, like files, fixes #334
This commit is contained in:
parent
cdabf629b6
commit
30783ce79c
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue