[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Difference between a+b and bit32.band(a+b)
- From: Petite Abeille <petite.abeille@...>
- Date: Sat, 10 Sep 2011 02:22:19 +0200
On Sep 10, 2011, at 2:05 AM, Mike Panetta wrote:
> Why would anyone expect io.lines to read binary files correctly? Binary
> files have no concept of a 'line'...
Good point :)
Nonetheless, io.lines does have a concept of lines, it's just that it's stripping the EOL marker by default, which is not necessarily what one might want when computing a hash or something.
In 5.2, you might want to use the '*L' option, instead of the default '*l' one:
• "*l": reads the next line skipping the end of line, returning nil on end of file. This is the default format.
• "*L": reads the next line keeping the end of line (if present), returning nil on end of file.
http://www.lua.org/work/doc/manual.html#pdf-file:read
- 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), Mike Panetta