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

Re: New user.



Sender: Scott Mildenberger <scottmildenberger@xxxxxxxxx>

Tim,

I have just recently done this for edi for some railroads.  I
used the ftp_list procedure to get the list of files and then
ftp_get to download them (see code excerpt below).  Depending on
the ftp server the rename function may move the files to another
directory if you specify it on the rename.  If it doesn't you
may be able to use the remote command procedure to do the move.

Scott Mildenberger

d Incoming        S            256A   dim(1000)


c                   if        ftp_list(Sess : ' ' : 1000 :
c                                      %addr(incoming) :
num_files) < 0

c                   callp     ftp_error(ErrNum)

c                   if        ErrNum = FTP_NOFILE
c                   eval      num_files = 0
c                   else
c                   callp     ftp_quit(Sess)
c                   return
c                   endif

c                   endif

 ** download all the files to the Ifs.
c                   eval      got_files = 0

c                   callp     ftp_binary(*on)

c     1             do        num_files     fileno
c                   eval      IfsDir = IfsRoot + %trim(FtpUser)
+
c                                           '/incoming/'
c                   eval      InFile = %subst(incoming(fileno) :
23 : 11)
 * download the rest of the files
c                   if        ftp_get(Sess         :
c                                     '#' + InFile :
c                                     %trim(IfsDir) +
%trim(InFile))>=0
c                   eval      got_files = got_files + 1




--- "Hatzenbeler, Tim" <thatzenbeler@xxxxxxxxxxxxx> wrote:
> Hi Scott and every one else...
> 
> I decided to avoid entering  the fray of nit picking on the
> midrnage list,
> and decided to learn something new today...  So hence I'm here
> using and
> exploring Scotts, FTPAPI.  1st off, thank you very much for
> the API, and the
> simple to get started readme file.  It worked like a charm,
> for some reason
> the freebsd url, wasn't resolving on my machine, but by
> replacing it with
> the ip address, your samples worked perfect...
> 
> However :-),  My project requires something that your samples
> do not
> provide, and was wondering, what the best approcah would be to
> complete it.
> I need to connect to an ftp server, and retrieve, all the
> files in a
> directory, ** and ** if the download was sucessful, move that
> file(s), into
> another directory on that server for archiving purposes.  
> 
> I saw your mget routine, but noticed the incoming field was
> dimmed to 50, if
> I make that bigger (1000) or so, would the api's support it? 
> Or would I use
> the mirroring routines, that you created?  And whats the best
> way to make
> sure the file I received on my machine, is an exact duplicate
> of the file on
> the server?  Is there way to byte compare?  And also, how do
> you move a
> file?  Is it the rename function?  And then delete?  I'm not
> very familiar
> with all the options of FTP other than put and get.
> 
> p.s.  This projects purpose, it to retrieve files from our as2
> server.  All
> day long, trading partners send our as2 server invoices, and
> i'm looking for
> a way to retrieve these files, and then archive them, on the
> as2 server.
> 
> Thank you for your time, tim.
> 
> 
> This e-mail message, including any attachments, is for the
> sole use of the
> intended recipient(s) and may contain confidential or
> privileged
> information.  Any unauthorized review, use, disclosure or
> distribution is
> prohibited.  If you are not the intended recipient, please
> contact the
> sender by reply e-mail and destroy the message.
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------