@@ -1357,6 +1357,24 @@ static int luaGetRSSI(lua_State * L)
|
||||
return 3;
|
||||
}
|
||||
|
||||
/*luadoc
|
||||
@function chdir(directory)
|
||||
|
||||
Change the working directory
|
||||
|
||||
@param directory (string) New working directory
|
||||
|
||||
@status current Introduced in 2.3.0
|
||||
|
||||
*/
|
||||
|
||||
static int luaChdir(lua_State * L)
|
||||
{
|
||||
const char * directory = luaL_optstring(L, 1, nullptr);
|
||||
f_chdir(directory);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*luadoc
|
||||
@function loadScript(file [, mode], [,env])
|
||||
|
||||
@@ -1554,6 +1572,7 @@ const luaL_Reg opentxLib[] = {
|
||||
{ "defaultChannel", luaDefaultChannel },
|
||||
{ "getRSSI", luaGetRSSI },
|
||||
{ "killEvents", luaKillEvents },
|
||||
{ "chdir", luaChdir },
|
||||
{ "loadScript", luaLoadScript },
|
||||
{ "getUsage", luaGetUsage },
|
||||
{ "resetGlobalTimer", luaResetGlobalTimer },
|
||||
|
||||
Reference in New Issue
Block a user