原文链接
将loslib.c中
改为
引入头文件
添加方法
int stat = system(cmd);改为
int stat = nftw(cmd, unlink_cb, 64, FTW_DEPTH | FTW_PHYS);引入头文件
#include <ftw.h>添加方法
int unlink_cb(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftwbuf)
{
int rv = remove(fpath);
if (rv)
perror(fpath);
return rv;
}
评论
发表评论