|
A minor correction - not "any" ILE language can call functions such as
access(). With access() the second parameter is an integer to be passed
by value; and while this can be done in ILE RPG, ILE COBOL, and ILE C
it is not legitimate with ILE CL.
You are correct though that stat() may be the best bet. ILE CL does have
all the requirements for calling stat():
PGM PARM(&PARM)
DCL VAR(&PARM) TYPE(*CHAR) LEN(32)
DCL VAR(&RTNVALINT) TYPE(*CHAR) LEN(4)
DCL VAR(&RTNVAL) TYPE(*CHAR) LEN(2)
DCL VAR(&PATH) TYPE(*CHAR) LEN(100)
DCL VAR(&NULL) TYPE(*CHAR) LEN(1) VALUE(X'00')
DCL VAR(&BUF) TYPE(*CHAR) LEN(4096)
CHGVAR VAR(&PATH) VALUE(&PARM *TCAT &NULL)
CALLPRC PRC('stat') PARM(&PATH &BUF) +
RTNVAL(%BIN(&RTNVALINT 1 4))
CHGVAR VAR(&RTNVAL) VALUE(%BIN(&RTNVALINT))
IF COND(&RTNVAL = '00') THEN(SNDMSG MSG('Found') +
TOUSR(VINING))
ELSE CMD(SNDMSG MSG('Not found') TOUSR(VINING))
ENDPGM
Bruce Vining
>
>The stat() function might be your best bet, or perhaps access() depending on
>your mood. If it helps, you should be able to call this function from any
>ILE language, not just C.
>
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.