home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / workbench / hypertext_dtc / arexx / ftp.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1996-11-10  |  1.5 KB  |  65 lines

  1. /*
  2. ** $PROJECT: HyperText-DataType-System
  3. **
  4. ** $VER: ftp.rexx 40.1 (10.11.96)
  5. **
  6. ** $AUTHOR: Stefan Ruppert , Windthorststrasse 5 , 65439 Floersheim , GERMANY
  7. **
  8. ** $COPYRIGHT: (C) Copyright 1996 by Stefan Ruppert, All Rights Reserved!
  9. **
  10. ** $EMAIL: Stefan.Ruppert@informatik.fh-wiesbaden.de
  11. **
  12. ** $REQUIRES: TCP/IP-Stack, FtpMount
  13. **
  14. ** $HISTORY:
  15. **
  16. ** 10.11.96 : 040.001 : initial
  17. **
  18. */
  19.  
  20. Options Results
  21.  
  22. Parse Arg args
  23.  
  24. /* --------------------------- needed libraries --------------------------- */
  25.  
  26. Call AddLib('rexxsupport.library',0,-30,0)
  27. Call AddLib('rexxdossupport.library',0,-30,0)
  28.  
  29. ftp.ftppath  = 'ftp://localhost/'
  30. ftp.localdir = 'Backup:download'
  31.  
  32. /* ------------------------ end customize section ------------------------- */
  33.  
  34. If ReadArgs(args,'FTPPATH/K,LOCALDIR/K,QUIET/S','FTP.') Then Do
  35.  
  36.    If ~ShowList('h','FTP') Then Do
  37.       Address Command 'Mount ftp:'
  38.  
  39.       If ~ShowList('h','FTP') Then Do
  40.      Say 'Cannot mount ftp-handler.'
  41.      Exit 10
  42.       End
  43.    End
  44.  
  45.    cmd = 'copy FROM="' || ftp.ftppath || '" TO="' || aminet.localdir || '"'
  46.  
  47.    If ~ftp.quiet Then
  48.       Say 'Running: ' || cmd
  49.  
  50.    Options Failat 21
  51.  
  52.    Address Command cmd
  53.  
  54.    If RC = 0 Then Do
  55.       If ~ftp.quiet Then Do
  56.      localfile  = AddPart(ftp.localdir, FilePart(ftp.ftppath))
  57.      Say 'Aminet download for ' || FilePart(ftp.ftppath) || ' finished :'
  58.      Address Command 'List ' || localfile || ' NOHEAD'
  59.       End
  60.    End
  61.    Else If ~ftp.quiet Then
  62.       Say 'Ftp download for ' || ftp.ftppath || ' failed !'
  63. End
  64.  
  65.