lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

>From: Steve Dekorte <>
> (Erik Hougaard) wrote:
>> What kind of memory buffers? ... I'm using tons O' buffers via the
>> userdata data type (and the tag system)
> wrote:
>> also, remember that strings in lua 3.1 can contain arbitrary data, including
>> embbeded zeros, and so are better described as byte arrays or memory buffers.
>I need to read binary files and then read, manipulate and save parts of it.
>I can do this with strings?


>Currently, when I write a string to a file
>using Lua the resulting file is ASCII, not binary.

what do you mean, "ASCII, not binary"?
this works:

	a= "lua\000is\001\great\007"

gives this file (hex dump below):

00000000  6c 75 61 00 69 73 01 67 - 72 65 61 74 07