[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FW: BATCH ftp ?
Sender: Mark Allen <allenmark@xxxxxxxx>
Mark Allen
I.S. Manager
Wilkes Telephone & Electric
A Dycom Company
Phone: (706) 678-9565
Email: allenmark@xxxxxxxx
http://www.nu-z.net
:-----Original Message-----
:From: midrange-l-admin@xxxxxxxxxxxx
:[mailto:midrange-l-admin@xxxxxxxxxxxx] On Behalf Of Mark Allen
:Sent: Friday, February 22, 2002 1:29 PM
:To: midrange-l@xxxxxxxxxxxx
:Subject: RE: BATCH ftp ?
:
:
:Having a problem with list and get. List brings back nothing,
:get always gives -4 error. Connects ok per job log. Doing
:manually with same works? Any ideas?
:
:Mark Allen
:I.S. Manager
:Wilkes Telephone & Electric
:A Dycom Company
:Phone: (706) 678-9565
:Email: allenmark@xxxxxxxx
:http://www.nu-z.net
:
:
:
:
::-----Original Message-----
::From: midrange-l-admin@xxxxxxxxxxxx
::[mailto:midrange-l-admin@xxxxxxxxxxxx] On Behalf Of Scott Klement
::Sent: Thursday, February 21, 2002 4:39 PM
::To: midrange-l@xxxxxxxxxxxx
::Subject: Re: BATCH ftp ?
::
::
::
::On Thu, 21 Feb 2002, Mark Allen wrote:
::>
::> Having a problem with getting this to do what I want. What
::I need it :> to do is stay in the FTP session after the dir
:in the sctipt file :> (listed :> below) because we do not know
:what the file name will be. I want the :> operator to
:manually enter the appropriate get command but the ftp :>
:session does an "implicit" quit after the last line of the FTP
:script :> and the runqry starts. Can I do wat I want or is
:the "whole" thing :> going to have to be manual. :>
::
::Err... once you run the FTP command, you can't exit it
:without :disconnecting from the server.
::
::A *much* easier way to do this would be with my open-source
::FTPAPI service program. It's designed to let you write your
::own FTP client with minimal effort, and make it do whatever you like.
::
::Here is an example of how you could do this with FTPAPI
::(example is in RPG IV):
::
:: C* Connect to server
:: C eval fd = ftp_conn('host': 'userid':
::'password')
:: C if fd < 0
:: c eval Msg = ftp_error
:: C* here you'd want to display the error message "MSG" and then abort
:: c endif
::
:: C* Change directory
:: C callp ftp_chdir(fd: 'pub/SomeDir/Somewhere')
::
:: C* do a "dir" to "my_array", one filename per array entry
:: C if ftp_list(fd: '*.txt': 5:
:: C %addr(my_array): num_files) < 0
:: c callp ftp_error(error_num)
:: c if error_num = FTP_NOFILE
:: C* no files were in that directory
:: c else
:: c eval msg = ftp_error
:: c* display error message here
:: c endif
::
:: C* grab each file in this directory
:: C for f = 1 to num_files
:: c callp ftp_get(fd: my_array(f): '/localdir/'+
:: c my_array(f))
:: c endfor
::
:: C* disconnect from server
:: c callp ftp_quit(fd)
::
::
::Much easier than trying to do the same thing with an FTP script!
::
::If you check the return code from every function (I only did
::it on ftp_conn and ftp_list in that example) you'd be able to
::detect every error in your transmission without having to
::parse a complicated output file.
::
::So, check it out... it's free, and only requires V3R2 or
::later. http://klement.dstorm.net/ftpapi/
::
::
::
::_______________________________________________
::This is the Midrange Systems Technical Discussion
:(MIDRANGE-L) :mailing list To post a message email:
:MIDRANGE-L@xxxxxxxxxxxx :To subscribe, unsubscribe, or change
:list options,
::visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
::or email: MIDRANGE-L-request@xxxxxxxxxxxx
::Before posting, please take a moment to review the archives
::at http://archive.midrange.com/midrange-l.
::
::
:
:
:_______________________________________________
:This is the Midrange Systems Technical Discussion (MIDRANGE-L)
:mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxx
:To subscribe, unsubscribe, or change list options,
:visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
:or email: MIDRANGE-L-request@xxxxxxxxxxxx
:Before posting, please take a moment to review the archives
:at http://archive.midrange.com/midrange-l.
:
:
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------