[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: opening a file in binary mode
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 21 Mar 2001 03:02:27 -0300 (EST)
>Didn't test this myself but how should `write' know how to emit userdata???
>Maybe you meant something like this (untested too ;-):
>
>static tobinary(lua_State* L)
>{
> double x = luaL_check_number(L, 1);
> lua_pushlstring(L, (const char *)&x, sizeof(x));
> return 1;
>}
Yes, this is much simpler (and can be used with `write'). Sorry about the noise.
--lhf