× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Ryan,

FWIW, if I do a GET with name format 0 and remote = 'MCSDTA/M08.M08' then
I get the path not found error.

If I do the GET with name format 1 and remote =
'/qsys.lib/mcsdta.lib/m08.file' then it works.

I can of course use the name format 1, but I'm curious as to why the first
doesn't work...

Thanks,

Peter Colpaert
Application Developer
PLI - IT - Kontich, Belgium
-----
Yoda of Borg are we. Futile is resistance, assimilated will you be.
-----



"Michael Ryan" <michaelrtr@xxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
12/12/2007 14:15
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
"RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
cc

Subject
Re: FTPAPI question






On further review...as you have in your code...from FTPAPI_H...

*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* FTP_NamFmt: Set the AS/400's Name Format (NAMEFMT) parm
*
* NOTE: This command is specific to the AS/400 FTP server
* and may not work on other systems.
*
* peSocket = socket number returned by FTP_conn
* peFormat = Name Fmt 0=MYLIB/MYFILE.MYMBR
* 1=/Filesys/MYLIB.LIB/MYFILE.FILE/MYMBR
*
* Returns -1 upon error, or 0 upon success
*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
D FTP_NamFmt PR 16P 0
D peSocket 10I 0 value
D peFormat 5I 0 value

So, since you're setting it correctly, does the file exist in whatever
your current directory is? File PDMEXT/M08 isn't qualified, so it will
check your current directory for that subdirectory and file. Do you
want /PDMEXT/M08 instead?

On Dec 12, 2007 7:58 AM, <Peter.Colpaert@xxxxxxxxx> wrote:
Hi group,

I'm in the middle of writing my first program using Scott's FTPAPI
service
program.

For some reason I cannot seem to get it to work using LIB/FILE.MEMBER
format, but it does work when using /qsys.lib notation.

What could I be doing wrong? The communication is between 2 iSeries
servers, both at V5R3:

d connection s 10i 0 inz
d objnampr s 10a inz('M08')
d objlibpr s 10a inz('PDMEXT')
d objtyppr s 10a inz('*FILE')
d returnpr s n inz
d msg_locked s 80a inz('The reservation file is
-
d locked, try again when it is
-
d available')
d msg_error s 80a inz
d msg_Ok s 80a inz('The reservation file was
-
d copied to the PDM zone')
d rc s 10i 0 inz
****** constanten
d c_host c '********'
d c_user c '********'
d c_pass c '********'
d c_remote c '/qsys.lib/MCSDTA.lib/M08.file'
d c_local c '/qsys.lib/PDMEXT.lib/M08.file'
** Program ds
/COPY qrpglecpy,DSSTATUS
****** Constanten
** prototypes
/copy qrpglecpy,prqc2le
/copy qrpglecpy,ftpapi_h
/copy qrpglecpy,prpdsyov05
/copy qrpglecpy,prpdsydt01

//**----------------------------------------------------------------***
//** parameter list *entry ***

//**----------------------------------------------------------------***

DPDIFPR33 PR

DPDIFPR33 PI

/free

Reset msg_locked;
Reset objnampr;
Reset objlibpr;
Reset objtyppr;
Reset returnpr;
Callp pdsyov05(objnampr:
objlibpr:
objtyppr:
returnpr);
If returnpr = *off;
Exsr GetFileFTP;
Else;
Callp pdsydt01(msg_locked);
EndIf;

*inlr = *on;
Return;

BegSr GetFileFTP;
connection = FTP_Conn(c_host:
c_user:
c_pass);
If connection < *zeros;
Callp pdsydt01(msg_error);
Else;
rc = FTP_NamFmt(connection:
1);
If rc < *zeros;
msg_error = FTP_Errormsg(connection);
Callp pdsydt01(msg_error);
Else;
rc = FTP_Sizereq(connection:
*off);
If rc < *zeros;
msg_error = FTP_Errormsg(connection);
Callp pdsydt01(msg_error);
Else;
rc = FTP_Logging(connection:
*on);
If rc < *zeros;
msg_error = FTP_Errormsg(connection);
Callp pdsydt01(msg_error);
Else;
rc = FTP_BinaryMode(connection:
*on);
If rc < *zeros;
msg_error = FTP_Errormsg(connection);
Callp pdsydt01(msg_error);
Else;
rc = FTP_get(connection:
c_remote:
c_local);
If rc < *zeros;
msg_error = FTP_Errormsg(connection);
Callp pdsydt01(msg_error);
Else;
callp pdsydt01(msg_ok);
EndIf;
EndIf;
EndIf;
EndIf;
EndIf;
rc = FTP_quit(connection);
EndIf;
EndSr;

If I do a call of FTP_NamFmt(connection:0) and use 'MCSDTA/M08' resp.
'PDMEXT/M08' for remote and local, the FTP_get returns an FTP_Errormsg
that says "No such path or directory."

Thanks,

Peter Colpaert




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.