Page 1 of 1

io.open(file, 'rb') reading in text mode

PostPosted: Mon Apr 11, 2016 6:39 pm
by davidk
Hello,

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?

Re: io.open(file, 'rb') reading in text mode

PostPosted: Tue Apr 12, 2016 6:25 am
by Julia CJ
Hi David,

Please make sure you have a 3.1.0 Indicore SDK version. Everything should work well with such version.

Re: io.open(file, 'rb') reading in text mode

PostPosted: Tue Apr 12, 2016 7:15 pm
by davidk
Indicore SDK 3.1 will work the current production version of FXTS?

Re: io.open(file, 'rb') reading in text mode

PostPosted: Wed Apr 13, 2016 5:14 pm
by davidk
That is, if I use indicore sdk 3.1, will Trading Station 1.14.x behave the same as sdk 3.1?

Re: io.open(file, 'rb') reading in text mode

PostPosted: Thu Apr 14, 2016 2:38 am
by Julia CJ
Hi David,

Please read about the problem in this thread:
viewtopic.php?p=104438#p104438

In the current production version of TS you need to apply the specified patch from the same forum thread. In the nearest time we will release the next Trading Station version and this problem will be solved.

Re: io.open(file, 'rb') reading in text mode

PostPosted: Fri Apr 15, 2016 7:31 pm
by davidk
Hello Julia,
Thanks for the link to the other thread. I'll follow those procedures and if I still have problems report the issues there.
Thanks again, David K.