linux c语言解压zipu压缩文件
linux c语言解压zip格式文件
#include
#include
int unzipFile(const char* fileName)
{
char command[256] = {0};
sprintf(command, "unzip %s", fileName);
return system(command);
}
//filePrefixName 文件名前缀
int unzipAllFile(const char* filePrefixName, int start, int end)
{
char command[256] = {0};
for(int i = start; i <= end; i++)
{
sprintf(command, "unzip %s%02d.zip", filePrefixName, i);
system(command);
}
return 0;
}
int main(int argc, char** argv)
{
//const char* fileName = argv[1];
//unzipFile(fileName);
unzipAllFile("sima_", 1, 2);
return 0;
}