Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vmbackupmanager: fixes for windows compatibility (#641)
* app/vmbackupmanager/storage: fix path join for windows See: #4704 Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com> * lib/backup: fixes for windows support - close dir before running os.RemoveAll. Windows FS does not allow to delete directory before all handles will be closed. - add path "normalization" for local FS to use the same format of paths for both *unix and Windows See #4704 Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com> --------- Signed-off-by: Zakhar Bessarab <z.bessarab@victoriametrics.com>
- Loading branch information
Showing
7 changed files
with
60 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
//go:build freebsd || openbsd || dragonfly || netbsd | ||
// +build freebsd openbsd dragonfly netbsd | ||
|
||
package fsremote | ||
|
||
func pathToCanonical(path string) string { | ||
return path | ||
} | ||
|
||
func canonicalPathToLocal(path string) string { | ||
return path | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package fsremote | ||
|
||
func pathToCanonical(path string) string { | ||
return path | ||
} | ||
|
||
func canonicalPathToLocal(path string) string { | ||
return path | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package fsremote | ||
|
||
func pathToCanonical(path string) string { | ||
return path | ||
} | ||
|
||
func canonicalPathToLocal(path string) string { | ||
return path | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package fsremote | ||
|
||
func pathToCanonical(path string) string { | ||
return path | ||
} | ||
|
||
func canonicalPathToLocal(path string) string { | ||
return path | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package fsremote | ||
|
||
import "strings" | ||
|
||
func pathToCanonical(path string) string { | ||
return strings.ReplaceAll(path, "\\", "/") | ||
} | ||
|
||
func canonicalPathToLocal(path string) string { | ||
return strings.ReplaceAll(path, "/", "\\") | ||
} |