james henderson
asked on
does library exist
Is there an api I can call in ile c++ to check for the existance of a library?
ASKER
Isn't there a way to do this from c/c++?
Hi
There will be a way to do it. The AS/400 comes with a whole array of C functions but I am not sure if you can code it from a PC. You could go the native API route but this is the easiest way.
Dave
There will be a way to do it. The AS/400 comes with a whole array of C functions but I am not sure if you can code it from a PC. You could go the native API route but this is the easiest way.
Dave
Dave seems right. I.e., there is no "C/C++" function specifically for this purpose, but there are a couple "APIs" that work.
E.g., you could call the rslvsp MI library function {to attempt] to resolve a system pointer to a *LIB object:
lib_ptr = rslvsp(_Library, "MYLIB", "QSYS", _AUTH_OBJ_MGMT);
Or, you could just call the standard Retrieve Object Description (QUSROBJD) API and request the *LIB object.
Tom
E.g., you could call the rslvsp MI library function {to attempt] to resolve a system pointer to a *LIB object:
lib_ptr = rslvsp(_Library, "MYLIB", "QSYS", _AUTH_OBJ_MGMT);
Or, you could just call the standard Retrieve Object Description (QUSROBJD) API and request the *LIB object.
Tom
ASKER
Thanks, all, but I found the answer myself.
Treat the library as a file: eg, /qsys.lib/mylib.lib. Use the stat c function. Works like a charm.
Treat the library as a file: eg, /qsys.lib/mylib.lib. Use the stat c function. Works like a charm.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
the easiest way is to create a cl program to do the job; then register it as a storred procedure.
The CL would have 2 ,parms - Library & return code.
Dave