mirror of
https://github.com/gilbertchen/duplicacy
synced 2025-12-10 21:33:19 +00:00
Add the \?\ prefix to all paths on Windows
This commit is contained in:
BIN
releases/2.1.2/duplicacy_osx_x64_2.1.2
Executable file
BIN
releases/2.1.2/duplicacy_osx_x64_2.1.2
Executable file
Binary file not shown.
@@ -10,10 +10,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
|
||||||
"path/filepath"
|
|
||||||
"regexp"
|
"regexp"
|
||||||
"runtime"
|
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"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 {
|
func PrettyNumber(number int64) string {
|
||||||
|
|
||||||
G := int64(1024 * 1024 * 1024)
|
G := int64(1024 * 1024 * 1024)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ package duplicacy
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
@@ -83,3 +84,7 @@ func (entry *Entry) SetAttributesToFile(fullPath string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func joinPath(components ...string) string {
|
||||||
|
return path.Join(components...)
|
||||||
|
}
|
||||||
|
|||||||
@@ -7,8 +7,10 @@ package duplicacy
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
"unsafe"
|
"unsafe"
|
||||||
|
"path/filepath"
|
||||||
)
|
)
|
||||||
|
|
||||||
type symbolicLinkReparseBuffer struct {
|
type symbolicLinkReparseBuffer struct {
|
||||||
@@ -114,3 +116,13 @@ func (entry *Entry) ReadAttributes(top string) {
|
|||||||
func (entry *Entry) SetAttributesToFile(fullPath 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
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user