From: penglei <1624952103@qq.com> Date: Fri, 20 Dec 2024 09:07:44 +0000 (+0800) Subject: 优化runtime文件存储 X-Git-Tag: v1.3.113-repair_tp~125^2~1 X-Git-Url: http://git.snicker.com.cn/css/static/gitweb.css?a=commitdiff_plain;h=bb340edd3ef8c6fff6a0a24144841097edbcd7d2;p=mirrors%2FFD230.git 优化runtime文件存储 --- diff --git a/code/sdk/drivers/peripheral/utils/custom_save_runtime.c b/code/sdk/drivers/peripheral/utils/custom_save_runtime.c index 094632a51..f01a39cbe 100644 --- a/code/sdk/drivers/peripheral/utils/custom_save_runtime.c +++ b/code/sdk/drivers/peripheral/utils/custom_save_runtime.c @@ -107,6 +107,16 @@ uint8_t uapi_runtime_file_count(char *folderpath) struct dirent *entry; uint8_t count = 0; + if(access(RUNTIME_LOG_SAVE_PATH, F_OK) == -1) + { + int ret = mkdir(RUNTIME_LOG_SAVE_PATH, 0777); + if(ret == -1) + { + PRINT("mkdir %s failed \r\n",RUNTIME_LOG_SAVE_PATH); + return 0; + } + } + dir = opendir(folderpath); if (dir == NULL) {