[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ftp_get to IFS
Sender: "Glenn McClenny" <gmcclenny@xxxxxxxxxxx>
It's never getting to the open statement because of this section of code:
*************************************************
* Parse the pathname that was given to us, so
* we know the library/filename when in QSYS.LIB
*************************************************
c if wwType='*FILE' or wwType='*MBR'
c or wwExists = *Off
c if ParsePath(wwPath: wwLib: wwObj:
c wwTmpMbr: wwTmpType) < 0
c return -1
c endif
c endif
The ParsePath() procedure returns -1.
The values in when debugging the program are:
wwType = *blanks
wwExists = *off
wwPath = /A123456789012345/INVOICES/I06012
(I06012 is the value of the Incoming(Array#))
wwLib = *blanks
wwObj = *blanks
wwTmpMbr = *blanks
wwTmpType = *blanks
Again, my ftp_get() is as follows:
dow FileNumber <= NumberOfFiles;
rc = ftp_get(sess : Incoming(FileNumber) :
'/A123456789012345/INVOICES/' +
%trim(Incoming(FileNumber)));
WorkMessage = ftp_errorMsg(sess);
FileNumber += 1;
enddo;
I've got the third parameter as the full path name and the file name to
create in the IFS. I think that's the right way to do it. It's almost as
if I'm doing something that makes the system think it's a type *FILE or
something.....
From: Scott Klement <sk@xxxxxxxxxxxxxxxx>
Reply-To: ftpapi@xxxxxxxxxxxxx
To: ftpapi@xxxxxxxxxxxxx
Subject: Re: ftp_get to IFS
Date: Tue, 24 Jan 2006 12:51:47 -0600 (CST)
Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>
After reading Scott's email, I'm wondering if I have the right version of
ftpapi. I've debugged the program, setting several breakpoints, and
here's where the issue is:
No, sorry... my fault. I was looking at a very old copy of FTPAPI
(possibly 1.0!) I was looking in the wrong library by mistake. You're
right, you need to look at the open() API in the OpnFile() subprocedure.
5499 *open the file to retrieve
5500 eval wwFD = OpnFile(wwLocal: 'W': p_write:
5501 p_close)
[SNIP]
After the OpnFile is done, wwFD is -1.
Yeah, that goes without saying that it's returning -1 (since that's the
code for all possible failures) The question is what's the contents of the
pathname at the time that the open() API (not OpnFile) is being called.
If you look deeper into the OpnFile() subproceudre, you'll find code like
this:
c when peRWflag='W'
c eval wwFD = open(%addr(wwPath): wwWFflags:
c DFT_MODE: wwNewCP)
c if wwFD < 0
c callp geterror(wwMsg)
c callp SetError(FTP_OPNERR:wwMsg)
c return -1
c endif
c eval peRdWrProc = %paddr('IF_WRITE')
c eval peClosProc = %paddr('IF_CLOSE')
What I want to know is what's the contents of the "wwPath" variable at the
time that this open() API runs. I don't care about the contents of wwFD --
I already know that it'll be -1. I want to know what wwPath is.
I didn't see the code that Scott listed in his reply. Something tells me
that he's going to yell and me, in a positive way of course, to install
the latest version :-)
No, it was my fault, sorry about that.
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------