<div dir="ltr">>><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><blockquote id="m_5116433996480666624gmail-m_-2501653393808151014m_-3415234719067270149gmail-m_-8502836825139548718mail-app-auto-quote" cite="http://16167337950000035236" style="border-left:1px solid rgb(8,120,189);margin:0px 0px 0px 10px;padding:0px 0px 0px 10px"><div><div><div id="m_5116433996480666624gmail-m_-2501653393808151014m_-3415234719067270149gmail-m_-8502836825139548718style_16167337950000035236_BODY">
>> This should work for gambas binary files like gbc3 or gba3<br>
>> Â Â Dim project As Integer = InStr(sfile, "/gambas" & System.version & <br>
>> "-" & System.Version, 1, gb.Binary)<br>
>> Â Â Dim length As Integer = InStr(sFile, "/", Project + 1, gb.binary) - <br>
>> project<br>
>> Â Â Print Mid(sFile, Project + 1, length - 1)<br>
>><br>
>> output would look like this<br>
>><br>
>> gambas3-3.15.90+git202103222309.dd1a35456+build14e27c76f~ubuntu20.04.1<br>
>><br>
>> "Failure is the key to success;<br>
>> Â each mistake teaches us something"Â .. Morihei Ueshiba<br>
>> Brian G<br>
>><br>
> <br>
> You should better run "gba3 -x <u></u> .startup" to get the <br>
> project startup configuration file contents and get the version from it.<br>
> <br>
> This is far more reliable!<br>
> <br>
> Regards,<br>
> <br>
<br>
Yes, well, loading a binary file into a string is pretty well going to <br>
have interesting side effects but in any case the the suggested approach <br>
for the ELF files doesn't work.<br>
<br>
For example, I have searched both gbc3 and gbx3 here and the "tickler" <br>
gambas3-3 does not occur in those files. I resume it is specific to ubuntu.<br>
<br>
b<br></div></div></div></blockquote></div></blockquote><div><br></div><div><div style="font-size:small">Thanks Brian and Benoit.</div><br></div><div style="font-size:small">The trouble is i also want the trunk version info.</div><div style="font-size:small">seems only the binary files have it, the .gambas files like gbs3 only have maj.min.rel info<br></div><div style="font-size:small">Using your function on gbs3 Brian my output didn't look anything like yours it looked like this...</div><div style="font-size:small"><b>Version=3.15.90</b><br></div></div></div></blockquote><div><br></div><div style="font-size:small" class="gmail_default">Sorry , that was the gbs3 output.</div><div style="font-size:small" class="gmail_default">The binary method worked for one system Debian-sid and failed for all the others :(</div><div style="font-size:small" class="gmail_default">Thank you though :)<br></div><div style="font-size:small" class="gmail_default">BruceS<br></div></div></div>