GetVersion()

AmigaOS users can make feature requests in this forum.
Post Reply
User avatar
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

GetVersion()

Post by mritter0 »

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);
Workbench Explorer - A better way to browse drawers
User avatar
colinw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 207
Joined: Mon Aug 15, 2011 9:20 am
Location: Brisbane, QLD. Australia.

Re: GetVersion()

Post by colinw »

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
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 530
Joined: Sat Jun 18, 2011 3:12 pm
Location: Finland
Contact:

Re: GetVersion()

Post by salass00 »

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
mritter0
Posts: 214
Joined: Mon Aug 25, 2014 9:41 pm
Location: Bettendorf, IA, USA

Re: GetVersion()

Post by mritter0 »

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.
Workbench Explorer - A better way to browse drawers
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 530
Joined: Sat Jun 18, 2011 3:12 pm
Location: Finland
Contact:

Re: GetVersion()

Post by salass00 »

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
colinw
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 207
Joined: Mon Aug 15, 2011 9:20 am
Location: Brisbane, QLD. Australia.

Re: GetVersion()

Post by colinw »

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.
Post Reply