You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by jo...@apache.org on 2017/07/11 01:39:08 UTC
[22/50] mesos git commit: Windows: Updated `os::rename()` to support
long paths.
Windows: Updated `os::rename()` to support long paths.
Review: https://reviews.apache.org/r/60322/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c412d3f3
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c412d3f3
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c412d3f3
Branch: refs/heads/master
Commit: c412d3f3ba253ad538c92ff5eef505ad19d86989
Parents: d472f8a
Author: Andrew Schwartzmeyer <an...@schwartzmeyer.com>
Authored: Mon Jul 10 10:51:53 2017 -0700
Committer: Joseph Wu <jo...@apache.org>
Committed: Mon Jul 10 17:15:35 2017 -0700
----------------------------------------------------------------------
3rdparty/stout/include/stout/os/windows/rename.hpp | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/c412d3f3/3rdparty/stout/include/stout/os/windows/rename.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/stout/include/stout/os/windows/rename.hpp b/3rdparty/stout/include/stout/os/windows/rename.hpp
index 544ff90..523912a 100644
--- a/3rdparty/stout/include/stout/os/windows/rename.hpp
+++ b/3rdparty/stout/include/stout/os/windows/rename.hpp
@@ -20,6 +20,8 @@
#include <stout/try.hpp>
#include <stout/windows.hpp>
+#include <stout/internal/windows/longpath.hpp>
+
namespace os {
@@ -36,9 +38,9 @@ inline Try<Nothing> rename(const std::string& from, const std::string& to)
// [1] https://msdn.microsoft.com/en-us/library/zw5t957f.aspx
// [2] http://man7.org/linux/man-pages/man2/rename.2.html
// [3] https://msdn.microsoft.com/en-us/library/windows/desktop/aa365240(v=vs.85).aspx
- const BOOL result = ::MoveFileEx(
- from.c_str(),
- to.c_str(),
+ const BOOL result = ::MoveFileExW(
+ ::internal::windows::longpath(from).data(),
+ ::internal::windows::longpath(to).data(),
MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING);
if (!result) {