From bb340edd3ef8c6fff6a0a24144841097edbcd7d2 Mon Sep 17 00:00:00 2001 From: penglei <1624952103@qq.com> Date: Fri, 20 Dec 2024 17:07:44 +0800 Subject: [PATCH] =?utf8?q?=E4=BC=98=E5=8C=96runtime=E6=96=87=E4=BB=B6?= =?utf8?q?=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- .../sdk/drivers/peripheral/utils/custom_save_runtime.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) { -- 2.17.1