Is there any reason to not implement Simbolic links under windows? I tryed the following quick and dirt mod and it seems to work.
#ifdef _WIN32
#include <windows.h>
#include <winbase.h>
#endif
static int make_link(lua_State *L)
{
const char *oldpath = luaL_checkstring(L, 1);
const char *newpath = luaL_checkstring(L, 2);
#ifndef _WIN32
return pushresult(L,
(lua_toboolean(L,3) ? symlink : link)(oldpath, newpath), NULL);
#else
int err = CreateSymbolicLink(newpath, oldpath, 0);
if (!err) return pusherror(L, "make_link is not supported on Windows");
else pushresult(L, lua_toboolean(L,3), NULL);
#endif
}
Note: I compiled with mingw and _WIN32_WINNT=0x0600 .