Re: io.read seems not right on windws, why?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: io.read seems not right on windws, why?
- From: Oliver Kroth <oliver.kroth@...>
- Date: Tue, 7 Mar 2017 10:44:37 +0100
Am 07.03.2017 um 10:36 schrieb R.wen:
hi,
I just test the simple code as follow,
local f = io.open("lua53.dll")
print(f:seek("end"))
print(f:seek("set"))
local str = f:read("a")
print(#str)
it is output is:
230400
0
201
it only read out 201 bytes, but the file size is 230400, what is wrong
here?
thanks,
rwen
You may have come along a ^Z (code 26), which is the DOS (and Windows)
EOF code in non-binary file access.
Try again with io.open( "lua53.dll", "rb")
--
Oliver