From 1b33317b2b8f47b1f9718a0eac1f495d9f42b4d0 Mon Sep 17 00:00:00 2001 From: jackyding Date: Tue, 15 Feb 2022 10:28:02 +0800 Subject: [PATCH] fix bug --- src/op/object_op.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/op/object_op.cpp b/src/op/object_op.cpp index f8d1536..fbb0ee3 100644 --- a/src/op/object_op.cpp +++ b/src/op/object_op.cpp @@ -1784,7 +1784,6 @@ CosResult ObjectOp::ResumableGetObject(const MultiGetObjectReq& req, CosResult head_result; // 1. 调用HeadObject获取文件长度 HeadObjectReq head_req(req.GetBucketName(), req.GetObjectName()); - ; HeadObjectResp head_resp; head_result = HeadObject(head_req, &head_resp); if (!head_result.IsSucc()) { @@ -1794,7 +1793,7 @@ CosResult ObjectOp::ResumableGetObject(const MultiGetObjectReq& req, std::string dir_name = FileUtil::GetDirectory(req.GetLocalFilePath()); std::string resumable_task_json_file = - dir_name + req.GetObjectName() + kResumableDownloadTaskFileSuffix; + dir_name + "/" + req.GetObjectName() + kResumableDownloadTaskFileSuffix; std::map resume_task_check_element = { {kResumableDownloadTaskLastModified, head_resp.GetLastModified()}, @@ -1865,20 +1864,20 @@ CosResult ObjectOp::ResumableGetObject(const MultiGetObjectReq& req, #if defined(_WIN32) // The _O_BINARY is need by windows otherwise the x0A might change into x0D // x0A - int fd = open(local_path.c_str(), _O_BINARY | O_WRONLY | O_CREAT | O_APPEND, + fd = open(local_path.c_str(), _O_BINARY | O_WRONLY | O_CREAT | O_APPEND, _S_IREAD | _S_IWRITE); #else - int fd = open(local_path.c_str(), O_WRONLY | O_CREAT | O_APPEND, + fd = open(local_path.c_str(), O_WRONLY | O_CREAT | O_APPEND, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); #endif } else { #if defined(_WIN32) // The _O_BINARY is need by windows otherwise the x0A might change into x0D // x0A - int fd = open(local_path.c_str(), _O_BINARY | O_WRONLY | O_CREAT | O_TRUNC, + fd = open(local_path.c_str(), _O_BINARY | O_WRONLY | O_CREAT | O_TRUNC, _S_IREAD | _S_IWRITE); #else - int fd = open(local_path.c_str(), O_WRONLY | O_CREAT | O_TRUNC, + fd = open(local_path.c_str(), O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); #endif }