[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: does read() work with binary files?
- From: David Jeske <jeske@...>
- Date: Thu, 21 May 1998 14:19:24 -0700
On Thu, May 21, 1998 at 06:05:25PM -0300, Roberto Ierusalimschy wrote:
> > Is read() known to work with binary files?
>
> Currently, "read()" is known *not* to work with binary files, because it
> returns a string, and a string cannot have a binary value 0. Therefore,
> whenever the binary file has a 0, we have a problem.
>
> The next version of Lua (3.1, not alpha) supports strings with arbitrary
> binary values (that is, they may have 0's inside them), and therefore will be
> able to read (and write) binary files.
Sounds great.
> > Is read(".") the right way to get a single byte out of a binary file?
>
> It will be.
This is great to hear. I've reverted to just "C-bytedumping" the
_source_ form of the lua file instead of the compiled form. When the real
3.1 is released, it sounds like my bytecomp script will work unchanged,
I'll just need to re-change my build process to compile the lua file
before c-bytedumping.
--
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@chat.net