]> git.eshelyaron.com Git - emacs.git/commitdiff
(ange-ftp-copy-files-async): New function for
authorSam Steingold <sds@gnu.org>
Fri, 12 Oct 2001 19:16:34 +0000 (19:16 +0000)
committerSam Steingold <sds@gnu.org>
Fri, 12 Oct 2001 19:16:34 +0000 (19:16 +0000)
 asynchronous multiple file copying.

lisp/ChangeLog
lisp/net/ange-ftp.el

index 1652e93c62e5798d00f9253f9e8d78eb56b81cf6..60b666358cf1d271d39e7c54f4e8a786b7f50fa2 100644 (file)
@@ -1,3 +1,8 @@
+2001-10-12  Sam Steingold  <sds@gnu.org>
+
+       * net/ange-ftp.el (ange-ftp-copy-files-async): New function for
+       asynchronous multiple file copying.
+
 2001-10-12  Gerd Moellmann  <gerd@gnu.org>
 
        * emacs-lisp/bytecomp.el (byte-compile-check-lambda-list): New
index b167879db1e5b09f61dc10d9eab25a03321716a7..1afc11306fa5ef224008e25241a62f271a673ed9 100644 (file)
@@ -3712,6 +3712,32 @@ Value is (0 0) if the modification time cannot be determined."
                               nil
                               nil
                               (interactive-p)))
+
+(defun ange-ftp-copy-files-async (okay-p line verbose-p files)
+  "Copy some files in the background.
+Arguments: (OKAY-P LINE VERBOSE-P FILES)
+OKAY-P must be T, and LINE does not matter.  They are here to make this
+ function a valid CONT argument for `ange-ftp-raw-send-cmd'.
+If VERBOSE-P is non-nil, print progress report in the echo area.
+ When all the files have been copied already, a message is shown anyway.
+FILES is a list of files to copy in the form
+  (from-file to-file ok-if-already-exists keep-date)
+E.g.,
+  (ange-ftp-copy-files-async t nil t '((\"a\" \"b\" t t) (\"c\" \"d\" t t)))"
+  (unless okay-p (error "%s: %s" 'ange-ftp-copy-files-async line))
+  (if files
+      (let* ((ff (car files))
+             (from-file    (nth 0 ff))
+             (to-file      (nth 1 ff))
+             (ok-if-exists (nth 2 ff))
+             (keep-date    (nth 3 ff)))
+        (ange-ftp-copy-file-internal
+         from-file to-file ok-if-exists keep-date
+         (and verbose-p (format "%s --> %s" from-file to-file))
+         (list 'ange-ftp-copy-files-async verbose-p (cdr files))
+         t))
+      (message "%s: done" 'ange-ftp-copy-files-async)))
+
 \f
 ;;;; ------------------------------------------------------------
 ;;;; File renaming support.