lua-users home
lua-l archive

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

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.

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                     
Cheshire Engineering Corp.