cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: AS/400 FTP server (was: My first post for verification)

From: Patrick Monnerat <Patrick.Monnerat_at_datasphere.ch>
Date: Fri, 28 Aug 2015 19:34:19 +0200

 
Ken Alverson wrote:

Please do not top-post: read
http://curl.haxx.se/mail/etiquette.html#Do_Not_Top_Post and comply.

> I was very interested in what you had to say about NAMEFMT 0 as that
is the format our older FTP c++ client is using. The older code works
with fine with QTEMP.

I have V6R1M0 here. I've tried with a cli FTP client to CWD to QTEMP: it
always fails. However I can upload to QTEMP without CWD by saying "put
somefile /QSYS.LIB/QTEMP.LIB/myfile.FILE" or "put somefile
/QSYS.LIB/QTEMP.LIB/myfile.FILE/mymember.MBR".

As a consequence, you have to
1) Use the format above, with an additional / in URL (i.e.:
ftp://as400server//QSYS.LIB/QTEMP.LIB/yourfile.FILE).
2) Set option CURLOPT_FTP_FILEMETHOD to FTPFILE_NOCWD.
3) Do not try to list QTEMP as a directory: it does not work :-(

> I am able to upload a program into QTEMP, run it, and then download
the results all in the same FTP session. It is ideal that it all goes
away after the FTP session; this is good.

This is your cooking :-) Frankly I would not trust it: your "program",
whatever it is (surely a script because you cannot upload a *PGM) is
executed in the server's job with the server context... But just do like
you want :-)

> I get about half way through the upload and the transfer gets
terminated due to an error
> * SSL_write() returned SYSCALL, errno = 10053

This tells me you have a M$W client: 10053 is WSAECONNABORTED and it is
M$-specific. I do not use W$ but I found that:
https://www.chilkatsoft.com/p/p_299.asp (this comforts me about what I
think of this... OS). It seems to concern TCP connection itself, so it
is not related to our current FTP problem (not on the same transmission
layer).

> When I attempt the same transfer to IFS with a path/file it works
fine. So it would seem this is a limitation or bug in CURL.

To my knowledge, there is no bug in curl at this level. It tries to
adapt to the underlying server as it can, but AS/400 server is very
deviant.

> I could spend time tracking it down and fixing it, or I could just
move to using IFS instead. I think for now, I will get it working in
the IFS.

Maybe you have file or record size problems, or file extends count
limitation. Also beware of transfer type (image/text) and if text,
ASCII->EBCDIC conversion errors.
If you try my suggestions above, you'll probably succeed... At least for
a reasonable upload to QTEMP.

By the way, from the partial verbose output you showed us, I can note
the "SITE NAMEFMT 1" has not been sent automatically. This is probably
due to an OS naming change in your version of OS/400 (You probably have
V7, don't you?). Can you please send me a full verbose output (please
erase the password to not publish it !!!), so I can update libcurl for
this situation? Thanks in advance.

Patrick

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2015-08-28