[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:33:54 +0200
On Sep 10, 2011, at 1:57 AM, waspoza wrote:
> while true do
> b = file:read(2^12)
> if not b then break end
> x:add(b)
> end
>
> Its uglier, but gives correct checksums.
If you prefer the for loop try something along these lines:
for b in function() return file:read( 2^12 ) end do
x:add( b )
end
> Looks like io.lines can't read binary files. :(
As mentioned, try the "*L" option.
http://www.lua.org/work/doc/manual.html#pdf-file:read