[lxc-devel] [lxd/master] Fix recursive file push on Windows
techtonik on Github
lxc-bot at linuxcontainers.org
Sun May 7 10:59:47 UTC 2017
A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 413 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20170507/e91d20a1/attachment.bin>
-------------- next part --------------
From b454c3d0c3a17f75daf8b4a258e88358e1be4970 Mon Sep 17 00:00:00 2001
From: anatoly techtonik <techtonik at gmail.com>
Date: Sun, 7 May 2017 13:57:52 +0300
Subject: [PATCH] Fix recursive file push on Windows
filepath.Walk() sends filenames with backslashes there
Signed-off-by: anatoly techtonik <techtonik at gmail.com>
---
client.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/client.go b/client.go
index c665294..4fbb202 100644
--- a/client.go
+++ b/client.go
@@ -1891,7 +1891,7 @@ func (c *Client) RecursivePushFile(container string, source string, target strin
appendLen--
}
- targetPath := path.Join(target, p[appendLen:])
+ targetPath := path.Join(target, filepath.ToSlash(p[appendLen:]))
if fInfo.IsDir() {
mode, uid, gid := shared.GetOwnerMode(fInfo)
return c.Mkdir(container, targetPath, mode, uid, gid)
More information about the lxc-devel
mailing list