#!/usr/bin/env newlisp ;; @module mftp ;; @description Enables multiple FTP transfers ;; @author cormullion (cormullion at mac dot com) ;; @author Tim Johnson tim at johnsons-web.com ;; @version 0.12 2008-04-11 2008-04-11 17:20:55 (version history at end) ;; @location http://unbalanced-parentheses.nfshost.com/downloads/ftp.lsp ;; ;;
After loading this module, there are two ways to transfer files to an FTP server: ;; the step by step way, and the all-in-one way.
;; Step by step: ;; ;; @example ;; (context FTP) ;; (connect "ftp.example.com") ;; (config 'quiet nil) ;; (login "username" "password" "tmp") ;; (send-file "test.txt") ; single file ;; (send-files '("test1.txt" "test2.txt")) ; list of files ;; (get-file "test3.txt") ; single file ;; (get-file "test3.txt" "temp-file-name.txt") ; doesn't overwrite local copy ;; (get-files '("test4.txt" "test5.txt")) ; list of files ;; (logout) ;; (disconnect) ;; All-in-one: ;; ;; @example ;; (FTP:upload "www.somedomain.com" "me" "mypwd" "/home/remote/me" '("file1.txt" "file2.txt")) ;; (FTP:download "www.somedomain.com" "me" "mypwd" "/home/remote/me" '("file3.txt" "file4.txt")) (context 'FTP) (set 'connection-socket1 nil 'logged-in? nil 'quiet true 'report true 'history nil 'intro "Connected to host. Upload follows:\n" 'report-file "Sending: " 'packet-marker "." 'control-vars '("quiet" "report" "intro" "report-file" "packet-marker")) ;; @syntax (FTP:config ...0.12 more fixes 2008-04-11 17:20:55
;;0.11 more documentation 2008-04-10 11:15:55
;;0.10 initial release 2008-04-07
;;Based on original code by Lutz and Eddie Rucker.
;;Basic functionality - enabled multiple uploads
;;Added edits, documentation, separated command port reporting from data transfer reporting.
;;Added config function.
;;