1
0
mirror of https://github.com/gilbertchen/duplicacy synced 2025-12-14 15:23:27 +00:00

Add the \?\ prefix to all paths on Windows

This commit is contained in:
Gilbert Chen
2018-11-08 21:29:02 -05:00
parent 2e5cbc73b9
commit 53548a895f
4 changed files with 17 additions and 16 deletions

View File

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