× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Right on, Rod. The gotcha with stat() is that it follows symbolic links -
like a shortcut in Windows. Of course, that'd normally not be a problem
with the QSYS.LIB part of IFS.

It seems the original poster would know the object type - right?

Your point that IFS is the whole system is something easy to forget. One of
the neat things here is that you are not limited to files & members - any
object type can be tested for existence There's an API to give you the
LIB/OBJ name of something in path format, but not the opposite direction,
AFAIK.

I guess I prefer the access() function because it's pretty simple. stat()
and lstat() have a structure that has to be processed - of course, a data
structure can do this, but there's no prototype in QSYSINC. Also, I suspect
that access() is less costly - the others return much more information - or
try  <g>

You could make a neat little procedure in RPG called
exists(objectname_in_path_format) that'd be implemented with either approach.

Lots of ways to do the same thing.

At 02:53 PM 8/28/02 +1000, you wrote:
>Unix api's stat() and lstat() can also do this. in addition they return the
>objectype.
>remember the IFS is the *whole* system. For qsys library system objects you
>must specify path in IFS style e.g.
>/qsys.lib/mylib.lib/myfile.file/mymbr.mbr
>
>Rod Orr
>
>From: Vernon Hamberg [mailto:vhamberg@attbi.com]
>
>You can check for existence of even QSYS objects with the access()
>Unix-Type API. Documentation is in the IFS section of Unix-type APIs. It's
>callable from RPG IV, just like other
>APIs,..............................................



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.