From e3ad2e2e73983966b5b84293a0f501e409abddde Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Tue, 21 Mar 2017 13:49:50 +0000 Subject: Replace std::ofstream with llvm::raw_fd_ostream Summary: ofstream does not handle paths with non-ascii characters correctly on windows, so I am switching these to llvm streams to fix that. Reviewers: zturner, eugene Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31079 llvm-svn: 298375 --- lldb/source/Target/Platform.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lldb/source/Target/Platform.cpp') diff --git a/lldb/source/Target/Platform.cpp b/lldb/source/Target/Platform.cpp index acafa8b35c5..7b9ab0dd6c9 100644 --- a/lldb/source/Target/Platform.cpp +++ b/lldb/source/Target/Platform.cpp @@ -1645,8 +1645,9 @@ Error Platform::DownloadModuleSlice(const FileSpec &src_file_spec, const FileSpec &dst_file_spec) { Error error; - std::ofstream dst(dst_file_spec.GetPath(), std::ios::out | std::ios::binary); - if (!dst.is_open()) { + std::error_code EC; + llvm::raw_fd_ostream dst(dst_file_spec.GetPath(), EC, llvm::sys::fs::F_None); + if (EC) { error.SetErrorStringWithFormat("unable to open destination file: %s", dst_file_spec.GetPath().c_str()); return error; -- cgit v1.2.3