summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-01-06 16:16:44 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-01-06 16:16:44 +0000
commit30e956d53d86b3375a7a7526992252e1eab90d1a (patch)
treec0ffe5558fe78d2d90e483a00758f137ce8b306b /plugins
parenta1d3c240615f4f429b3b363a70f79a117abaf810 (diff)
Mirlua: added DeleteFile function
git-svn-id: http://svn.miranda-ng.org/main/trunk@16035 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/MirLua/src/m_windows.cpp9
1 files changed, 9 insertions, 0 deletions
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 },