GetVersion()

AmigaOS users can make feature requests in this forum.

GetVersion()

Postby mritter0 » Sun Sep 11, 2016 8:51 pm

How about adding a command to get a file/program's version string?

Code: Select all
IDOS->GetVersion(Path,
    GETVERSION_FullString, &buffer,
    GETVERSION_Version, &version,
    GETVERSION_Revision, &revision,
    GETVERSION_Date, &datebuffer,
    GETVERSION_Comment, &commentbuffer,   (the extended comment at end)
TAG_DONE);
mritter0
 
Posts: 181
Joined: Mon Aug 25, 2014 10:41 pm
Location: Bettendorf, IA, USA

Re: GetVersion()

Postby colinw » Mon Sep 12, 2016 1:16 am

The best you can hope for is information that is actually stored in an executable.

Check out the autodocs for; IDOS->GetSegListInfoTags()
Specifically for the tags; GSLI_VersionString, GSLI_ResidentVersionString and GSLI_ResidentStruct.

There is also example code at the bottom.
User avatar
colinw
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 155
Joined: Mon Aug 15, 2011 10:20 am
Location: Brisbane, QLD. Australia.

Re: GetVersion()

Postby salass00 » Sat Sep 17, 2016 5:21 pm

colinw wrote:Check out the autodocs for; IDOS->GetSegListInfoTags()
Specifically for the tags; GSLI_VersionString, GSLI_ResidentVersionString and GSLI_ResidentStruct.


A function to help parse the version string into its components (name, version, revision and date) might still be useful just so everyone doesn't have to roll their own functions for this.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 462
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: GetVersion()

Postby mritter0 » Sun Sep 18, 2016 1:42 am

C:version path full >T:version.txt

then Parsing the text file is so old school. ;)

It should also work for devices/volumes. Colinw's suggestion doesn't work for them.
mritter0
 
Posts: 181
Joined: Mon Aug 25, 2014 10:41 pm
Location: Bettendorf, IA, USA

Re: GetVersion()

Postby salass00 » Sun Sep 18, 2016 8:25 am

mritter0 wrote:It should also work for devices/volumes. Colinw's suggestion doesn't work for them.


I guess you mean file systems because the device and volume entries do not have version strings attached.

In order to get the version string of a running file system you just have to get the seglist pointer and pass it to the function that Colin mentioned. IIRC I posted some code to do this on www.amigans.net a while back.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 462
Joined: Sat Jun 18, 2011 4:12 pm
Location: Finland

Re: GetVersion()

Postby colinw » Sun Sep 18, 2016 12:18 pm

mritter0 wrote: C:version path full >T:version.txt
then Parsing the text file is so old school. ;)

It should also work for devices/volumes. Colinw's suggestion doesn't work for them.


C:Version works with all filesystem "device" names.
ie: ENV: RAM: APPDIR: ....
But not currently with the "volume" names.
User avatar
colinw
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 155
Joined: Mon Aug 15, 2011 10:20 am
Location: Brisbane, QLD. Australia.


Return to AmigaOS Feature Requests

Who is online

Users browsing this forum: No registered users and 1 guest