--- mojosetup-original/lua_glue.c 2009-04-26 01:55:19.000000000 +0200 +++ mojosetup/lua_glue.c 2009-04-26 01:59:26.000000000 +0200 @@ -1081,6 +1081,17 @@ static int luahook_platform_mkdir(lua_St return retvalBoolean(L, MojoPlatform_mkdir(dir, perms)); } // luahook_platform_mkdir +static int luahook_platform_chmod(lua_State *L) +{ + const char *filestr = luaL_checkstring(L,1); + const char *permstr = luaL_checkstring(L,2); + uint16 perms = 0; + boolean valid = false; + perms = MojoPlatform_makePermissions(permstr, &valid); + if( !valid ) + fatal(_("BUG: '%0' is not a valid permission string"), permstr); + return MojoPlatform_chmod(filestr, perms); +} // luahook_chmod static int luahook_platform_installdesktopmenuitem(lua_State *L) { @@ -1780,6 +1791,7 @@ boolean MojoLua_initLua(void) set_cfunc(luaState, luahook_platform_mkdir, "mkdir"); set_cfunc(luaState, luahook_platform_installdesktopmenuitem, "installdesktopmenuitem"); set_cfunc(luaState, luahook_platform_uninstalldesktopmenuitem, "uninstalldesktopmenuitem"); + set_cfunc(luaState, luahook_platform_chmod, "chmod"); lua_setfield(luaState, -2, "platform"); // Set the GUI functions...