From e400e93ea1648e84a52b061cb059db186920c9ec Mon Sep 17 00:00:00 2001 From: payton Date: Wed, 6 Sep 2023 15:49:00 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81=E4=BD=BF?= =?UTF-8?q?=E7=94=A8FileSys=20api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rtos/code/driver/na51089/source/mcu/sf_mcu.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/rtos/code/driver/na51089/source/mcu/sf_mcu.c b/rtos/code/driver/na51089/source/mcu/sf_mcu.c index 6ec99d445..be290a099 100755 --- a/rtos/code/driver/na51089/source/mcu/sf_mcu.c +++ b/rtos/code/driver/na51089/source/mcu/sf_mcu.c @@ -2168,7 +2168,7 @@ void sf_file_thumb_cfg_sava(void) FST_FILE fs = 0; //char buff[SF_SEND_LIST_ITEM_LENGTH+1] = {0}; //int fd = 0; - static int flag = 0; + //static int flag = 0; //struct stat st; #if SF_IQ_TEST != ENABLE INT32 uiStatus = 0; @@ -2184,17 +2184,11 @@ void sf_file_thumb_cfg_sava(void) //printf("Add %s to send.List\n", sendfname); if(0 == puiPara->SendType){ snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_AUTO); - if((access(sendListName, F_OK) == 0) && (0 == flag)) - { - printf("%s:%d DeleteFile:%s\r\n", __FUNCTION__, __LINE__, sendListName); - if (FileSys_DeleteFile(sendListName) != FST_STA_OK) { - DBG_IND("Ignore deleting file.\r\n"); - } - } - flag = 1; + fs = FileSys_OpenFile(sendListName, FST_CREATE_ALWAYS | FST_OPEN_WRITE); }else { snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_LIST); + fs = FileSys_OpenFile(sendListName, FST_OPEN_ALWAYS | FST_OPEN_WRITE); } /*if(access(sendListName, F_OK) == 0) @@ -2205,7 +2199,6 @@ void sf_file_thumb_cfg_sava(void) else { fd = open(sendListName, O_APPEND | O_WRONLY | O_CREAT); }*/ - fs = FileSys_OpenFile(sendListName, FST_OPEN_ALWAYS | FST_OPEN_WRITE); if(/*fd*/fs) { FileSys_StatFile(fs, &FileStat);