However there is a catch: when defining scheduled events, for example like making daily backups there is often necessary to provide the destination path (if not default) for the backup file in the stored procedure.
This is where angels stop singing.
If the remote VServer is on Windows, the path goes like C:\users\chris\documents...
If the remote VServer is on Linux, the path goes like /home/chris/Documents...
How to tell from the client side what OS the server is running on?
What I do now is to misuse the INI file at the installation time and piggyback this info there:
; Optional but very recommended to specify.
Crash_Reporter_Owner_Name=Chris_Whatever (Linux)
And then in my client code harvest this tidbit:
char * getServerOS
( /* <= "", "Windows", "Linux", "Mac" */
VConnection dbConnectionP,
VDatabase dbP
)
{
static char buf[256];/* <> in: variable name, out: variable value */
strcpy ( buf, "Crash_Reporter_Owner_Name" );
if ( nomadicApi_getServerVariable ( dbConnectionP, NULL, buf ) )
{
char *c1P = strchr ( buf, '(' );
char *c2P = strrchr ( buf, ')' );
if ( c1P && c2P && c1P < c2P )
{
*c2P = '\0';
return ( c1P + 1 );
}
}
return ( "" );
}
It's an ugly hack, I know.
But is there a better way to inform the client about the remote VServer platform?
Best!
/Chris