struct stat file_inf;
int ret = 0;
+ if(access(folderPath, F_OK) == -1)
+ {
+ if(ret == -1)
+ {
+ PRINT("%s does not exist!!!\r\n", folderPath);
+ return -1;
+ }
+ }
+
dir = opendir(folderPath);
if (dir == NULL)
{
return -1;
}
+ if((entry = readdir(dir)) == NULL)
+ {
+ PRINT("%s is empty\r\n",folderPath);
+ return -1;
+ }
+
if(access(tarPath, F_OK) == -1)
{
ret = mkdir(tarPath, 0777);
/* Close archive */
mtar_close(&tar);
closedir(dir);
+ removeFilesInFolder(folderPath);
return ret;
}