[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: does read() work with binary files?
- From: Roberto Ierusalimschy <roberto@...>
- Date: Thu, 21 May 1998 18:00:00 -0300
> 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.
> Is read(".") the right way to get a single byte out of a binary file?
It will be.