From 30e956d53d86b3375a7a7526992252e1eab90d1a Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Wed, 6 Jan 2016 16:16:44 +0000 Subject: Mirlua: added DeleteFile function git-svn-id: http://svn.miranda-ng.org/main/trunk@16035 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/MirLua/src/m_windows.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'plugins/MirLua') diff --git a/plugins/MirLua/src/m_windows.cpp b/plugins/MirLua/src/m_windows.cpp index 5dc231cc6a..ce5c53809c 100644 --- a/plugins/MirLua/src/m_windows.cpp +++ b/plugins/MirLua/src/m_windows.cpp @@ -1259,6 +1259,14 @@ static int global_WriteFile(lua_State *L) { } /***/ +static int global_DeleteFile(lua_State *L) +{ + const char *path = luaL_checkstring(L, 1); + BOOL result = DeleteFileA(path); + lua_pushboolean(L, result); + return 1; +} + static int global_WaitForSingleObject(lua_State *L) { long h = MYP2HCAST luaL_checknumber(L, 1); DWORD t = (DWORD)luaL_checknumber(L, 2); @@ -2122,6 +2130,7 @@ static luaL_Reg winApi[] = { "CreateFile", global_CreateFile }, { "ReadFile", global_ReadFile }, { "WriteFile", global_WriteFile }, + { "DeleteFile", global_DeleteFile }, { "TerminateProcess", global_TerminateProcess }, { "GetExitCodeProcess", global_GetExitCodeProcess }, { "WaitForSingleObject", global_WaitForSingleObject }, -- cgit v1.2.3