|
Jeff,
In your example, is the Open() API returning a -1? (Check the FileDs
variable for a -1 and see.)
If so, then I don't understand how the file is being created? You say it
is, but if open() is returning -1, that means it failed, so the file should
not have been created.
if FileDs is NOT -1, then your code is wrong. You should not be checking
errno UNLESS FileDs is -1. errno always returns the last error that has
occurred in your job (even if it was an error produced a long time ago in a
different program, as long as it was the last error you received, errno
will return it.) You should only check errno when you know the API failed
because the API returned a -1. Otherwise you're picking up an irrelevant
error.
-SK
On 9/5/2014 10:38 AM, Jeff Young wrote:
All,--
Using this code:
FileDs = Open(%Trim(IFS_File_Name)
: O_CREAT +
O_WRONLY +
O_CCSID +
O_TEXTDATA +
O_TEXT_CREAT +
O_INHERITMODE
: 0
: 1252
: 0
);
The value in IFS_File_Name is 'PAYCHEX/INBOX/ERRORS/J229_GL.csv'
The current directory for the job is '/' and the path is valid.
Before the open, I have verified that the file does not exist in the
directory.
After the open, the file does exist.
Using the following code I am receiving the error 'No such path or
directory'
p_ErrNo = sys_errno;
p_Msg = strerror (errno);
If ErrNo > *Zero;
.
.
.
endif
What am I missing?
TIA,
Jeff Young
Sr. Programmer Analyst
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
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.