mirror of
https://github.com/jkl1337/duplicacy.git
synced 2026-01-02 11:44:45 -06:00
Add the \?\ prefix to all paths on Windows
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user