lua-users home
lua-l archive

Re: io.read seems not right on windws, why?

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


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

AltStyle によって変換されたページ (->オリジナル) /