× 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.



Peter,

FTPAPI only understands IFS naming. It has no notion of the traditional naming format.

The FTP_NamFmt() API changes the SERVER's name format, but doesn't change the client's naming format (i.e. it doesn't change FTPAPI's format.)

so you could potentially do

FTP_NamFmt(connection: 0);
FTP_Get(connection: 'LIB/FILE': '/QSYS.LIB/LIB.LIB/FILE.FILE');

In that case, you've told the server to use naming format 0, so you can request an object named 'LIB/FILE'. However, to save it on the client side (where FTPAPI runs) you have to specify the IFS naming ("namefmt 1").

Why didn't I support both naming formats? Because it's more work. It would've required extra code -- and I didn't see the point in adding the extra code, since IFS naming provides access to everything. Adding the other naming format wouldn't have provided any additional capability.

Also, "namefmt" is NOT a standard part of the FTP protocol. It's an extension that only exists on OS/400. All other systems use hierarchical naming, much like "namefmt 1".

Having said that, I may end up adding support for namefmt 0 some day in the future. I personally don't need it, but it seems like everyone else wants it.

Also, I have a mailing list set up explicitly for FTPAPI and HTTPAPI. We'd love to see you there.
http://www.scottklement.com/ftpapi/ftpapilist.html



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
Application Developer
PLI - IT - Kontich, Belgium
-----
Yoda of Borg are we. Futile is resistance, assimilated will you be.
-----


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.