# --- T2-COPYRIGHT-NOTE-BEGIN --- # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # T2 SDE: package/.../lua-posix/mktemp.patch # Copyright (C) 2008 The T2 SDE Project # # More information can be found in the files COPYING and README. # # This patch file is dual-licensed. It is available under the license the # patched project is licensed under, as long as it is an OpenSource license # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms # of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # --- T2-COPYRIGHT-NOTE-END --- diff -urN posix.orig/lposix.c posix/lposix.c --- posix.orig/lposix.c 2008-02-28 17:37:32.000000000 +0100 +++ posix/lposix.c 2008-02-28 17:45:41.000000000 +0100 @@ -257,6 +257,13 @@ return pushresult(L, mkdir(path, 0777), path); } +static int Pmktemp(lua_State *L) /** mktemp(path) */ +{ + char *path = strdup (luaL_checkstring(L, 1)); + lua_pushstring(L, mktemp(path)); + free (path); + return 1; +} static int Pchdir(lua_State *L) /** chdir(path) */ { @@ -810,6 +817,7 @@ {"kill", Pkill}, {"link", Plink}, {"mkdir", Pmkdir}, + {"mktemp", Pmktemp}, {"mkfifo", Pmkfifo}, {"pathconf", Ppathconf}, {"putenv", Pputenv},