From 85c0513d0aa127cf2a6a9d8e19e309c5ab9d2b00 Mon Sep 17 00:00:00 2001 From: LZY Date: Mon, 24 Apr 2023 18:20:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=98=E5=9B=BE=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 5c4b71f..43a5bc9 100644 --- a/main.cpp +++ b/main.cpp @@ -4,7 +4,7 @@ #include #define K_VISION_DIR "/hard/k_vision" -#define AI_VISION_DIR "/hard/ai_vision" +#define AI_VISION_DIR "/ssd/ai_vision" namespace fs = boost::filesystem; @@ -204,8 +204,16 @@ int main(int argc, char* argv[]) { fs::path path(it); auto strName = path.filename().string(); std::string strPath = std::string(szSaveDir) + strName; - fs::copy_file(it,strPath,fs::copy_option::overwrite_if_exists); - ++i; + boost::system::error_code err_code; + fs::copy_file(it,strPath,fs::copy_option::overwrite_if_exists, err_code); + if (err_code.value() == 0) + { + ++i; + } + else + { + std::cout << "error: copy file failed - " << it << std::endl; + } if (i % 50 == 0) { std::cout << "info: copy progress " << i << "/" << vec_matched_path.size() << std::endl;