On Fri, Jun 19, 2020 at 11:17 PM Reinhard Kotucha <[email protected]>
wrote:
> Hi,
> it's nice that with the fio library LuaTeX can now process binary
> files. What I'm missing is the ability to specify the byte order
> (little vs. big endian).
>
>
I don't knwo if it can help,
but if you can use ffi I think you can know the endianness of the current
platform with with this code:
\directlua{
ffi.cdef [[
union endianness {
int32_t i;
char c[4];
}
]]
local x = ffi.new('union endianness x',{i=1})
if(x.c[0]==1) then
print "little endian"
else
print "big endian"
end
}
\end
--
luigi