[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.1 (alpha) now available
- From: David Burgess <dburgess@...>
- Date: Thu, 8 Sep 2005 07:55:30 +1000
I would beg for the following small addition to liolib.c
(
+#ifdef _WIN32
+static int f_setmode (lua_State *L) {
+ int res;
+ const char* mode = luaL_optstring(L,2,"b");
+ int bmode = *mode == 'b' ? _O_BINARY : _O_TEXT ;
+ res = _setmode(_fileno(tofile(L)),bmode) != -1;
+
+ return pushresult(L, res, NULL);
+}
+#endif
+#ifdef _WIN32
+ {"setmode", f_setmode},
+#endif
David B