× 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.



Hey, Scott, as you told me once, access() is not intended for CL (until V5R3). It DOES work for existence - at least it always has for me - but is probably not to be trusted. It's an accident, because the variable for specifying what kind of test you are running is supposed to be passed by value, not by reference. Anyway, I've been lucky, I guess.

I don't hear you saying CL, but that was the context of the original post. So that makes CHKOUT/CHKIN the easiest from a pure CL standpoint.

Regards
Vern

At 11:38 AM 7/9/2004, you wrote:

Hi Adam,

> I have a CL program that uses CHKDLO to determine the existence of a folder.
> We are changing things around to use directories. What would the equivalent
> command be to check for the existence of a directory?


The "right" way is to use the access() API.  You check for the existence
of a directory in the exact same manner that you check for the existence
of a stream file -- search the archives, there have been 2 or 3 threads
about checking for a stream file.

the stat() API is another way to go.  It's a bit slower than access(), but
it has the added advantage that you can pick apart the mode to see if the
file is actually a directory (as opposed to a stream file)  I know that
I've posted examples of this in the past as well.

I personally DON'T like using CHKIN or CHKOUT for this.  They allocate the
resources to your job, and I don't think that's what you want to do.

I also wouldn't use DSPLNK because of the overhead of creating a spooled
file -- but it's certainly a lot better than using CHKIN or CHKOUT.

> I assume we can't use wrklnk, because that will actually display the
> screen.  Also, what would the correct msgid be?

WRKLNK is interactive, it's not really what you're looking for.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.