in reply to Portable way to extract string from a binary

Hi Michael

Err... did you check your doc? ;-)

syb_oc_version (string)
Returns the identification string of the version of Client Library that this binary is currently using. This is a read-only attribute.

For example:

troll (7:59AM):348 > perl -MDBI -e '$dbh = DBI->connect("dbi:Sybase:", "sa"); print "$dbh->{syb_oc_version}\n";'
Sybase Client-Library/11.1.1/P/Linux Intel/Linux 2.2.5 i586/1/OPT/Mon Jun 7 07:50:21 1999

This is very useful information to have when reporting a problem.

Sorry... I just had to do it... ;-) A little teasing here

Jason L. Froebe

No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

Edit by tye, remove PRE tags around long lines

  • Comment on Re: Portable way to extract string from a binary

Replies are listed 'Best First'.
Re^2: Portable way to extract string from a binary
by mpeppler (Vicar) on Jul 14, 2004 at 14:31 UTC
    But that's after the module is built - I need this before...:-)

    Michael

      Lol.. yup, I know, I'm opening a case with Sybase on it. Will let you know what I find.

      This is what I asked in the case:

      basically I'm looking for something like so:

      $ my_app --openclient-version
      ----
      This application is using OpenClient 12.5.1 ebf 9999 for Linux 64bit. This application was BUILT using OpenClient 12.5.1 ebf 9980.
      ---

      The "built" line would be hard coded by the application during the compilation process - I would handle this...

      The "using" would be read from some method in the openclient library (ctlib or dblib) that my application is using *now*.

      I'm looking for a way to determine the "using" openclient version without performing a system call to run the ldd or strings commands.

      A little more than what we are looking for but, I think it would be a better solution

      Jason L. Froebe

      No one has seen what you have seen, and until that happens, we're all going to think that you're nuts. - Jack O'Neil, Stargate SG-1

      Edit by tye, remove PRE tags around long lines

        Well - if you've got an app that is compiled with client lib or dblib it's pretty simple to get the version - ct_config(CS_VER_STRING) for ctlib, and dbversion() in dblib, and these will return the version string from the current library (i.e. the one dynamically linked in).

        Michael