check:添加上载文件列表时,检查文件是否存在,防止输入错误。
This commit is contained in:
parent
208cd56ee3
commit
004d894129
@ -100,6 +100,12 @@ bool CClient::up_task(const std::string& cmd)
|
|||||||
auto list = CFileOpr::get_file_list(cmd);
|
auto list = CFileOpr::get_file_list(cmd);
|
||||||
std::string msg;
|
std::string msg;
|
||||||
for (const auto& item : list) {
|
for (const auto& item : list) {
|
||||||
|
|
||||||
|
if (!fs::exists(item)) {
|
||||||
|
logger_->error("File {} not exist, please check!", item);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (msg.empty()) {
|
if (msg.empty()) {
|
||||||
msg.append(item);
|
msg.append(item);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user