home *** CD-ROM | disk | FTP | other *** search
/ Computer Buyer 1996 June / BUYER_696.iso / internet / ameol / ameolnt / ftplslr.sc_ / ftplslr.sc
Text File  |  1995-01-16  |  2KB  |  79 lines

  1. REM FTPLSLR.SCR v1.21 "Get FTP recursive directory of a UNIX site" 
  2. REM Contributed by mentha@cix
  3. REM Ameol script to give a recursive ls -lR listing of all the files from
  4. REM a user-specified starting directory on a UNIX anonymous ftp site.
  5. REM When run, you need to specify:-
  6. REM 1. your PC filename in which to store the directory (eg lslr.wri)
  7. REM 2. the Unix ftp site name (eg world.std.com)
  8. REM 3. the ftp site's initial directory to list (try /pub if unknown).
  9. REM !!! Full ls -lR listings can run to megabytes !!!
  10. REM You may find a file on the site that already holds an lslR listing.
  11. REM Modified 9/94 to check for RFC 250 'Chdir okay' before proceeding.
  12. REM +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  13. status "Requesting FTP lslR listing..."
  14. put "run internet"
  15. if waitfor( "M:", "ip>" ) == 1
  16. put "ftp %s('lslR of FTP Site','Enter UNIX FTP Site Name:')"
  17. if waitfor("ftp>","):")==0
  18.  status "FTP connection failed."
  19.  put "quit"
  20.  waitfor "ip>"
  21.  put "quit"
  22.  waitfor "M:"
  23.  status ""
  24.  end
  25. endif
  26. REM Connection successful...
  27. put "anonymous"
  28. if waitfor("ftp> ","assword:")==0
  29.  status "FTP site terminated connection."
  30.  put "quit"
  31.  waitfor "ip>"
  32.  put "quit"
  33.  waitfor "M:"
  34.  status ""
  35.  end
  36. endif
  37. putnocr name
  38. put "@cix.compulink.co.uk"
  39. waitfor "ftp>"
  40. put "prompt"
  41. waitfor "ftp>"
  42. put "ascii"
  43. waitfor "ftp>"
  44. put "cd %s('lslR of FTP Site','Enter top-level directory:\n(Try /pub if not known)')"
  45. if waitfor("ftp>", "250 ")==0
  46.  status "Unable to change to specified directory."
  47.  put "quit"
  48.  waitfor "ip>"
  49.  put "quit"
  50.  waitfor "M:"
  51.  status ""
  52.  end
  53. endif
  54. status "Downloading from Site to Cix..."
  55. put "ls -lR ftplslr.wri"
  56. waitfor "ftp>"
  57. put "quit"
  58. waitfor "ip>"
  59. put "dir ftplslr.wri"
  60. if waitfor("ip> ","              ^M^J ")==0
  61.  status "No FTP lslR listing to download."
  62.  put "quit"
  63.  waitfor "M:"
  64.  status ""
  65.  end
  66. endif
  67. REM lslR successful...
  68. waitfor "ip>"
  69. status "Receiving lslR from Cix..."
  70. put "send ftplslr.wri"
  71. download "%fs('Save ls -lR of FTP Site As','0','ls -lR Listing (*.wri)\f*.wri\f')"
  72. status "FTP ls -lR received."
  73. put "erase ftplslr.wri"
  74. waitfor "ip>"
  75. put "quit"
  76. waitfor "M:"
  77. endif
  78. status ""
  79. end