[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Difference between a+b and bit32.band(a+b)
- From: Ross Berteig <Ross@...>
- Date: Fri, 09 Sep 2011 17:41:16 -0700
At 05:33 PM 9/9/2011, Petite Abeille wrote:
>> Looks like io.lines can't read binary files. :(
>As mentioned, try the "*L" option.
And don't forget to open the file in binary mode as well,
regardless of the Lua version. It won't matter on Linux, but on
Windows, the default text mode will turn all CRLF pairs into a
single newline character, which will also disturb a checksum.
http://www.lua.org/work/doc/manual.html#pdf-io.open
Note that if you used io.input() to open the file (which you
probably did since you are using io.lines() rather than
file:lines() in your code fragment) you don't get the chance to
set the file to binary mode.
Ross Berteig Ross@CheshireEng.com
Cheshire Engineering Corp. http://www.CheshireEng.com/
- References:
- Difference between a+b and bit32.band(a+b), waspoza
- Re: Difference between a+b and bit32.band(a+b), Duncan Cross
- Re: Difference between a+b and bit32.band(a+b), Luiz Henrique de Figueiredo
- Re: Difference between a+b and bit32.band(a+b), waspoza
- Re: Difference between a+b and bit32.band(a+b), Lee Hickey
- Re: Difference between a+b and bit32.band(a+b), waspoza
- Re: Difference between a+b and bit32.band(a+b), Duncan Cross
- Re: Difference between a+b and bit32.band(a+b), waspoza
- Re: Difference between a+b and bit32.band(a+b), waspoza
- Re: Difference between a+b and bit32.band(a+b), Petite Abeille