|
Mark, When weird things happen, look at the activation group. Problem 1) When your open() fails, what does it do? Just return a -1 handle? Look at FilePath - does it terminate in x'00'? Problem 2) I have used '__errno' exactly as you have and had no problems with it. I posted a code snippet earlier that works (populates the error code) when it can't open the file. Did you bind to the correct '__errno'? (I don't even know if there's another somewhere. I use BNDDIR(QC2LE) I am on V4R3. Buck Calabro Aptis; Albany, NY > -----Original Message----- > From: MSievers@promega.com > Sent: Thursday, January 13, 2000 11:12 AM > To: RPG400-L@midrange.com > Subject: Having problems accessing IFS from RPGIV > > I am having 2 problems access the IFS system from an RPGIV program. Any > help would be greatly appreciated. We are running v4r2. > > 1) I am having a weird problem with my open() function. It will work > fine > the day I compile the program but the next day it will fail. If I > recompile > the program without making any source changes it will again for that day. > On both days I am trying to open the same text file. The text file has > not > be altered in any way. The open is for ready only. > > 2) I am trying to retrieve the value of errno when a function fails > without > success. Here is a snippet of my code. The variable errno always > contains > 0 even when the FileHandle is -1. > > D errnoF PR * EXTPROC('__errno') > > D errnoP S * > D errno S 10I 0 BASED(errnoP) > > C Eval FileHandle=open(%addr(FilePath):oflag) > C EVAL errnoP = errnoF > C 'errno' DSPLY errno > +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-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-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.