[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: TESTPUT



Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>

Hi Shannon,

The first one does not work, and the second one does.
RPath1  and  CPath1 are both 256 A.

Very curious.

0 c                   if        ftp_put(sess:
0 C                             '/QSYS.LIB/SOCKETS.LIB/WORKFILE1.FILE':
0 C                             '/QSYS.LIB/SOCKETS.LIB/WORKFILE1.FILE')

I'm trying to duplicate the problem. Unfortunately, I have access to only one iSeries machine, so I have to try sending the file to LOCALHOST to try to reproduce the problem.


So I created a library called SOCKETS, and I create a file called WORKFILE1 in that library. I then attempted to send it to a file called WORKFILE2 using FTP to LOCALHOST.

Everything worked for me. It did not matter if I used variables or not. The only thing that was kinda weird was that the record length and external definition was not reproduced -- but that's to be expected. (You have to send a savf if you want them reproduced)

Here's the code I used to test (FTPAPI v2.0):

H BNDDIR('LIBFTP/FTPAPI') DFTACTGRP(*NO) ACTGRP(*NEW)

/COPY LIBFTP/FTPAPISRC,FTPAPI_H .

     D Msg             S             52A
     D sess            S             10I 0
     D RPath1          s            256A
     D CPath1          s            256A

     C     *ENTRY        PLIST
     c                   PARM                    Server           32
     c                   PARM                    UserID           32
     c                   PARM                    Password         32

     c                   eval      sess = ftp_conn( Server
     c                                            : UserID
     c                                            : Password )
     c                   if        sess < 0
     c                   eval      Msg = ftp_errorMsg(0)
     c                   dsply                   Msg
     c                   eval      *inlr = *on
     c                   return
     c                   endif

     c                   eval      RPath1 = '/QSYS.LIB/SOCKETS.LIB/'
     c                                    + 'WORKFILE2.FILE'

     c                   eval      CPath1 = '/QSYS.LIB/SOCKETS.LIB/'
     c                                    + 'WORKFILE1.FILE'

     c                   callp     ftp_binaryMode(sess: *on)
      /if defined(USEVAR)
     c                   if        ftp_put(sess
     c                                    : RPath1
     c                                    : CPath1 ) < 0
      /else
     c                   if        ftp_put(sess
     c                                    : '/QSYS.LIB/SOCKETS.LIB/'
     c                                          + 'WORKFILE2.FILE'
     c                                    : '/QSYS.LIB/SOCKETS.LIB/'
     c                                          + 'WORKFILE1.FILE') < 0
      /endif
     c                   eval      Msg = ftp_errorMsg(sess)
     c                   dsply                   Msg
     c                   endif

     c                   callp     ftp_quit(sess)
     c                   eval      *inlr = *on
     c                   return

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------