From 55fa29f359d3cf57d8fb21c556de2ab452d889eb Mon Sep 17 00:00:00 2001 From: huangyongan Date: Mon, 24 Apr 2023 20:19:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=86=97=E4=BD=99=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/main.cpp b/main.cpp index 43a5bc9..9d354f6 100644 --- a/main.cpp +++ b/main.cpp @@ -4,7 +4,7 @@ #include #define K_VISION_DIR "/hard/k_vision" -#define AI_VISION_DIR "/ssd/ai_vision" +#define AI_VISION_DIR "/hard/ai_vision" namespace fs = boost::filesystem; @@ -132,15 +132,10 @@ std::string get_file_timestamp_str(const std::string& strPath) if (strPath.empty()) { return str; - } - fs::path path(strPath); - if (!fs::exists(path)) - { - return str; - } + } str = path.filename().string(); - str = str.substr(0, 15); - return str; + auto strTime = str.substr(0, 15); + return strTime; } int main(int argc, char* argv[]) { @@ -205,7 +200,7 @@ int main(int argc, char* argv[]) { auto strName = path.filename().string(); std::string strPath = std::string(szSaveDir) + strName; boost::system::error_code err_code; - fs::copy_file(it,strPath,fs::copy_option::overwrite_if_exists, err_code); + fs::copy_file(it, strPath, fs::copy_option::overwrite_if_exists, err_code); if (err_code.value() == 0) { ++i;