添加清空前检查功能

同步删除tosend.ini文件
This commit is contained in:
CSSC-WORK\murmur 2023-09-11 18:04:40 +08:00
parent bd8e6381da
commit 05678a7944

View File

@ -22,6 +22,7 @@ extern rt_sem_t okToreport;
extern void resetTM(void); extern void resetTM(void);
unsigned long getFileSize(char *file); unsigned long getFileSize(char *file);
void updateSysRTC(uint8_t *din, size_t len); void updateSysRTC(uint8_t *din, size_t len);
int isFileExit(char *f);
#define CFG_ACK #define CFG_ACK
/** /**
* ack信号 * ack信号
@ -956,8 +957,13 @@ void clearAllData()
//去掉原static //去掉原static
//static int cmd_rm(int argc, char **argv) //static int cmd_rm(int argc, char **argv)
//MSH_CMD_EXPORT_ALIAS(cmd_rm, rm, Remove(unlink) the FILE(s).); //MSH_CMD_EXPORT_ALIAS(cmd_rm, rm, Remove(unlink) the FILE(s).);
char *arg[]={"rm","-r",ROOT_PATH_DATA}; DIR *dir = opendir(ROOT_PATH_DATA);
cmd_rm(3,arg); if (dir && isFileExit("/sd/tosend.ini"))
{
closedir(dir);
char *arg[]={"rm","-r",ROOT_PATH_DATA,"/sd/tosend.ini" };
cmd_rm(4,arg);
}
LOG_D("files deleted."); LOG_D("files deleted.");
} }