I have some simple code that worked in SDK2, but doesn't with SDK3. My code opens a file in binary mode, reads the first 32 bytes and then works with that binary data as a string. Like this:
- Code: Select all
f = io.open(name, 'rb');
s = f:read(32);
offset = string.find(s, 'RR')
With SDK3 io.read() is only reading until the first crlf (about 7 bytes) and is having trouble reading binary 0's. Seems like io.open() is not obeying the binary mode.
Is there a way I can open a file in binary mode with SDK3?
Thanks,
David K.
PS. I've had other problems with the io library in SDK3. Is there copy of the lua io library that's close to the SDK2 library I can use?