1.优化代码使用FileSys api
This commit is contained in:
parent
9fa3a0833d
commit
e400e93ea1
|
@ -2168,7 +2168,7 @@ void sf_file_thumb_cfg_sava(void)
|
||||||
FST_FILE fs = 0;
|
FST_FILE fs = 0;
|
||||||
//char buff[SF_SEND_LIST_ITEM_LENGTH+1] = {0};
|
//char buff[SF_SEND_LIST_ITEM_LENGTH+1] = {0};
|
||||||
//int fd = 0;
|
//int fd = 0;
|
||||||
static int flag = 0;
|
//static int flag = 0;
|
||||||
//struct stat st;
|
//struct stat st;
|
||||||
#if SF_IQ_TEST != ENABLE
|
#if SF_IQ_TEST != ENABLE
|
||||||
INT32 uiStatus = 0;
|
INT32 uiStatus = 0;
|
||||||
|
@ -2184,17 +2184,11 @@ void sf_file_thumb_cfg_sava(void)
|
||||||
//printf("Add %s to send.List\n", sendfname);
|
//printf("Add %s to send.List\n", sendfname);
|
||||||
if(0 == puiPara->SendType){
|
if(0 == puiPara->SendType){
|
||||||
snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_AUTO);
|
snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_AUTO);
|
||||||
if((access(sendListName, F_OK) == 0) && (0 == flag))
|
fs = FileSys_OpenFile(sendListName, FST_CREATE_ALWAYS | FST_OPEN_WRITE);
|
||||||
{
|
|
||||||
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;
|
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
snprintf(sendListName, sizeof(sendListName), "%s", SF_THUMB_SEND_LIST);
|
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)
|
/*if(access(sendListName, F_OK) == 0)
|
||||||
|
@ -2205,7 +2199,6 @@ void sf_file_thumb_cfg_sava(void)
|
||||||
else {
|
else {
|
||||||
fd = open(sendListName, O_APPEND | O_WRONLY | O_CREAT);
|
fd = open(sendListName, O_APPEND | O_WRONLY | O_CREAT);
|
||||||
}*/
|
}*/
|
||||||
fs = FileSys_OpenFile(sendListName, FST_OPEN_ALWAYS | FST_OPEN_WRITE);
|
|
||||||
if(/*fd*/fs)
|
if(/*fd*/fs)
|
||||||
{
|
{
|
||||||
FileSys_StatFile(fs, &FileStat);
|
FileSys_StatFile(fs, &FileStat);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user