[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Transferring *SAVF leaves file open
Jonathan,
I'd like to help, but I can't get LIBFTP to compile this morning. It looks
like I installed a different version of some of the copy files.
My thoughts were like this...
What does the server log show when you script it or run it interactively?
Does ftp_quit return an error code? You might want to check that it is being
sent correctly.
It looks like you pretty much followed the put example, so the code appears
to be okay.
Are you using the latest release (2.2 or at least 2.1--see changelog in
qrpglesrc for versions)?
If you are ok there...are there any messages in the joblog?
If still no happiness...I think you might have to break out the comm trace
and find out what is missing from LIBFTP. I've only used the AS400 version
(strcmntrc) a couple of times. It is usable, but not all that friendly. Of
course, if you could get wireshark on the line where the ftp is passing
through, that would probably work better. Run both ways (interactive and
LIBFTP) and see what is different. In either case, I'd make the savf as
small as possible so you can avoid looking at page after page of data and
just find the commands and "overhead".
Mike Krebs
-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Jonathan Mason
Sent: Wednesday, October 31, 2007 6:23 PM
To: 'HTTPAPI and FTPAPI Projects'
Subject: RE: Transferring *SAVF leaves file open
Hi List
Does anybody have any ideas on this?
Thanks
Jonathan
-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Jonathan Mason
Sent: 19 October 2007 12:59
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: Transferring *SAVF leaves file open
Hi All
I'm just starting to get to grips with the FTPAPI and trying to transfer
*SAVF objects to a Windows based FTP server. If I use the FTP client
directly either interactively or with the following script the file
transfers ok:
userid password
cd apollo
bin
put QGPL/TRANSFER transfer.savf
quit
However, if I use the following RPG program to try and do the same thing the
file stays open and has an "in use" lock on it within Windows:
H BndDir('LIBFTP/FTPAPI')
***************************************************************************
** D A T A D E F I N I T I O N S
***************************************************************************
D Session s 10i 0
D Msg s 52a
D FTPRtn s 10i 0
***************************************************************************
** P R O T O T Y P E S
***************************************************************************
D/Include LIBFTP/QRPGLESRC,FTPAPI_H
D AUKR121M03 Pr
D iSavf 10a
***************************************************************************
** I N T E R F A C E
***************************************************************************
D AUKR121M03 Pi
D iSavf 10a
***************************************************************************
** M A I N L I N E C O D E
***************************************************************************
C* Connect to the FTP server...
C Eval Session =
FTP_Conn('uranus' : 'userid' :
C 'password')
C* Change to the APOLLO directory on the server...
C CallP FTP_ChDir(Session :
'apollo')
C* Go to binary mode...
C CallP FTP_BinaryMode(Session :
*On)
C* Put the save file on the server...
C Eval FTPRtn = FTP_Put(Session
:
C %Trim(iSavf) + '.savf'
:
C
'/QSYS.LIB/QGPL.LIB/TRANSFER.FILE')
C If FTPRtn < 0
C Eval Msg =
FTP_ErrorMsg(Session)
C Dsply Msg
C EndIf
C* Exit from the FTP server...
C CallP FTP_Quit(Session)
C* Exit from the program...
C Eval *InLr = *On
C Return
When I check the FTP server log I see the following:
[5] Fri 19Oct07 12:52:03 - (000071) Connected to
192.168.0.101 (Local address 192.168.0.1)
[6] Fri 19Oct07 12:52:03 - (000071) 220 Serv-U FTP Server
v6.4 for WinSock ready...
[2] Fri 19Oct07 12:52:03 - (000071) USER userid
[6] Fri 19Oct07 12:52:03 - (000071) 331 User name okay, need
password.
[2] Fri 19Oct07 12:52:03 - (000071) PASS xxxxx
[5] Fri 19Oct07 12:52:03 - (000071) User FTPBACKUP logged in
[6] Fri 19Oct07 12:52:03 - (000071) 230 User logged in,
proceed.
[5] Fri 19Oct07 12:52:03 - (000071) IP-Name: S65AA1AB
[2] Fri 19Oct07 12:52:03 - (000071) CWD apollo
[6] Fri 19Oct07 12:52:04 - (000071) 250 Directory changed to
/apollo
[2] Fri 19Oct07 12:52:04 - (000071) TYPE I
[6] Fri 19Oct07 12:52:04 - (000071) 200 Type set to I.
[2] Fri 19Oct07 12:52:04 - (000071) PORT
192,168,0,101,20,154
[6] Fri 19Oct07 12:52:04 - (000071) 200 PORT Command
successful.
[2] Fri 19Oct07 12:52:04 - (000071) STOR TRANSFER.savf
[6] Fri 19Oct07 12:52:04 - (000071) 150 Opening BINARY mode
data connection for TRANSFER.savf.
[4] Fri 19Oct07 12:52:04 - (000071) Receiving file
c:\ftp\apollo\transfer.savf
Has anybody any idea what it is I'm doing wrong?
Thanks
Jonathan
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------