美文网首页
iOS 使用wax报错'system' is unavailab

iOS 使用wax报错'system' is unavailab

作者: 卤蛋两枚 | 来源:发表于2019-10-24 11:33 被阅读0次

    1.在waxlua文件下的loslib.c文件 #include <ftw.h>
    2.增加unlink_cb方法

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

    3.更改system方法为nftw方法

    lua_pushinteger(L, system(luaL_optstring(L, 1, NULL)));
    改成
    lua_pushinteger(L, nftw(luaL_optstring(L, 1, NULL), unlink_cb, 64, FTW_DEPTH | FTW_PHYS));
    

    修改效果如下图所示

    修改前的图片 修改后的图片

    相关文章

      网友评论

          本文标题:iOS 使用wax报错'system' is unavailab

          本文链接:https://www.haomeiwen.com/subject/vpervctx.html