iOS Lua 报错'system' is unavailable: not available on iOS

将loslib.c中
int stat = system(cmd);
改为
int stat = nftw(cmd, unlink_cb, 64, FTW_DEPTH | FTW_PHYS);
引入头文件
#include
添加方法

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;
}

听雨阁

你可能感兴趣的:(iOS Lua 报错'system' is unavailable: not available on iOS)