diff --git a/releases/2.1.2/duplicacy_osx_x64_2.1.2 b/releases/2.1.2/duplicacy_osx_x64_2.1.2 new file mode 100755 index 0000000..cd02eb0 Binary files /dev/null and b/releases/2.1.2/duplicacy_osx_x64_2.1.2 differ diff --git a/src/duplicacy_utils.go b/src/duplicacy_utils.go index de18c90..a82eabf 100644 --- a/src/duplicacy_utils.go +++ b/src/duplicacy_utils.go @@ -10,10 +10,7 @@ import ( "fmt" "io" "os" - "path" - "path/filepath" "regexp" - "runtime" "strconv" "strings" "time" @@ -390,19 +387,6 @@ func MatchPath(filePath string, patterns []string) (included bool) { } } -func joinPath(components ...string) string { - - combinedPath := path.Join(components...) - if len(combinedPath) > 257 && runtime.GOOS == "windows" { - combinedPath = `\\?\` + filepath.Join(components...) - // If the path is on a samba drive we must use the UNC format - if strings.HasPrefix(combinedPath, `\\?\\\`) { - combinedPath = `\\?\UNC\` + combinedPath[6:] - } - } - return combinedPath -} - func PrettyNumber(number int64) string { G := int64(1024 * 1024 * 1024) diff --git a/src/duplicacy_utils_others.go b/src/duplicacy_utils_others.go index 64398dd..fc35134 100644 --- a/src/duplicacy_utils_others.go +++ b/src/duplicacy_utils_others.go @@ -9,6 +9,7 @@ package duplicacy import ( "bytes" "os" + "path" "path/filepath" "syscall" @@ -83,3 +84,7 @@ func (entry *Entry) SetAttributesToFile(fullPath string) { } } + +func joinPath(components ...string) string { + return path.Join(components...) +} diff --git a/src/duplicacy_utils_windows.go b/src/duplicacy_utils_windows.go index 201751f..720600d 100644 --- a/src/duplicacy_utils_windows.go +++ b/src/duplicacy_utils_windows.go @@ -7,8 +7,10 @@ package duplicacy import ( "fmt" "os" + "strings" "syscall" "unsafe" + "path/filepath" ) type symbolicLinkReparseBuffer struct { @@ -114,3 +116,13 @@ func (entry *Entry) ReadAttributes(top string) { func (entry *Entry) SetAttributesToFile(fullPath string) { } + +func joinPath(components ...string) string { + + combinedPath := `\\?\` + filepath.Join(components...) + // If the path is on a samba drive we must use the UNC format + if strings.HasPrefix(combinedPath, `\\?\\\`) { + combinedPath = `\\?\UNC\` + combinedPath[6:] + } + return combinedPath +}