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

Section for all discussions related to development using Indicore API/SDK.

Moderator: admin

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

Postby davidk » Mon Apr 11, 2016 6:39 pm

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?
davidk
 
Posts: 8
Joined: Wed May 08, 2013 9:09 pm

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

Postby Julia CJ » Tue Apr 12, 2016 6:25 am

Hi David,

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

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

Postby davidk » Tue Apr 12, 2016 7:15 pm

Indicore SDK 3.1 will work the current production version of FXTS?
davidk
 
Posts: 8
Joined: Wed May 08, 2013 9:09 pm

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

Postby davidk » Wed Apr 13, 2016 5:14 pm

That is, if I use indicore sdk 3.1, will Trading Station 1.14.x behave the same as sdk 3.1?
davidk
 
Posts: 8
Joined: Wed May 08, 2013 9:09 pm

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

Postby Julia CJ » Thu Apr 14, 2016 2:38 am

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.
Julia CJ
 

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

Postby davidk » Fri Apr 15, 2016 7:31 pm

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.
davidk
 
Posts: 8
Joined: Wed May 08, 2013 9:09 pm


Return to Discussions

Who is online

Users browsing this forum: No registered users and 1 guest

cron