Community discussions

MikroTik App
 
xrlls
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 51
Joined: Sun Jan 13, 2019 4:43 pm

String lengths

Fri Sep 29, 2023 12:10 pm

Hi,

I am writing a script that fetches the latest release note and forwards and excerpt to a server backend, put I am struggling with no text showing of the release note is long.

An example:
tool/fetch  http://upgrade.mikrotik.com/routeros/7.12beta7/CHANGELOG
:put [file/get CHANGELOG contents ]
Results in no output, while if doing the same with a (much) shorter release note it works:
tool/fetch  http://upgrade.mikrotik.com/routeros/7.11.2/CHANGELOG
:put [file/get CHANGELOG contents ]
Results in the release note being shown as expected.

I suspect that I am running in to some limitation of ROS string lengths, but I am not sure if I somehow can work around this.

Any suggestions are much appreciated! :)
 
msatter
Forum Guru
Forum Guru
Posts: 2912
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Re: String lengths

Fri Sep 29, 2023 12:42 pm

The problem is not the variable but that fetch retrieves up 64KB and then you have to use chunking if you want more data.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12014
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: String lengths

Fri Sep 29, 2023 3:48 pm

Why uselessly do that?
Simply the backend read https://upgrade.mikrotik.com/routeros/7 ... /CHANGELOG
 
xrlls
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 51
Joined: Sun Jan 13, 2019 4:43 pm

Re: String lengths  [SOLVED]

Sat Sep 30, 2023 11:29 am

I agree that it would be more efficient to let the backend handle it. But the backend is beyond my control.

I got it working using this approach:
global test [/tool/fetch "http://upgrade.mikrotik.com/routeros/7.12beta9/CHANGELOG" output=user as-value]
Instead of having the intermediate step where it is stored as a file.

Who is online

Users browsing this forum: No registered users and 5 guests