|
On 26 October 2016 at 18:33, D Freinkel (a4g)
<DFreinkel@xxxxxxxxxxxxxxxxx> wrote:
The return code is 3025.Assuming you're using the C functions to open the file, there is a
variable that the C documentation will call ERRNO. Knowing that name
is actually useful, because you can search the web for ERRNO 3025 and
find web sites like
https://publib.boulder.ibm.com/iseries/v5r2/ic2924/index.htm?info/apis/unix14.htm
3025 is the classic 'No path or directory'. We RPG programmers tend
to ignore blanks, but they are quite important to the C functions.
there is a big difference between these two things:
dcl-s file1 char(64); inz('thisfile');
dcl-s file2 varchar(64); inz('thisfile');
fp = open(file1); // 3025
fp = open(file2); // opens
This is because file1 is actually 'thisfile' followed by a bunch of
blanks, and blanks -- even trailing blanks -- are legal in file names.
So when IBM i tries to find 'file1
' it probably can't.
I like variable length fields for this purpose. If you have to get
the file name off a display or other block mode record, consider
%trimr() to get it into the variable length field.
--buck
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.