Function: ange-ftp-cf1

ange-ftp-cf1 is a byte-compiled function defined in ange-ftp.el.gz.

Signature

(ange-ftp-cf1 RESULT LINE FILENAME NEWNAME BINARY MSG F-PARSED F-HOST F-USER F-NAME F-ABBR T-PARSED T-HOST T-USER T-NAME T-ABBR TEMP1 TEMP2 CONT NOWAIT)

Source Code

;; Defined in /usr/src/emacs/lisp/net/ange-ftp.el.gz
;; next part of copying routine.
(defun ange-ftp-cf1 (result line
			    filename newname binary msg
			    f-parsed f-host f-user _f-name f-abbr
			    t-parsed t-host t-user t-name t-abbr
			    temp1 temp2 cont nowait)
  (if line
      ;; filename must have been remote, and we must have just done a GET.
      (unwind-protect
	  (or result
	      ;; GET failed for some reason.  Clean up and get out.
	      (progn
		(and temp1 (ange-ftp-del-tmp-name temp1))
		(or cont
		    (if ange-ftp-waiting-flag
			(throw 'ftp-error t)
		      (signal 'ftp-error
			      (list "Opening input file"
				    (format "FTP Error: \"%s\"" line)
				    filename))))))
	;; cleanup
	(if binary
	    (ange-ftp-set-ascii-mode f-host f-user))))

  (if result
      ;; We now have to copy either temp1 or filename to newname.
      (if t-parsed

	  ;; newname was remote.
	  (progn
	    (if (ange-ftp-use-gateway-p t-host)
		(setq temp2 (ange-ftp-make-tmp-name t-host)))

	    ;; make sure data is moved into the right place for the
	    ;; outgoing transfer.  gateway temporary files complicate
	    ;; things nicely.
	    (if temp1
		(if temp2
		    (if (string-equal temp1 temp2)
			(setq temp1 nil)
		      (ange-ftp-real-copy-file temp1 temp2 t))
		  (setq temp2 temp1 temp1 nil))
	      (if temp2
		  (ange-ftp-real-copy-file filename temp2 t)))

	    (if binary
		(ange-ftp-set-binary-mode t-host t-user))

	    ;; tell the process filter what size the file is.
	    (let ((attr (file-attributes (or temp2 filename))))
	      (if attr
		  (ange-ftp-set-xfer-size t-host t-user
					  (file-attribute-size attr))))

	    (ange-ftp-send-cmd
	     t-host
	     t-user
	     (list 'put (or temp2 (ange-ftp-quote-string filename)) t-name)
	     (or msg
		 (if (and temp2 f-parsed)
		     (format "Putting %s" newname)
		   (format "Copying %s to %s" f-abbr t-abbr)))
	     (list 'ange-ftp-cf2
		   newname t-host t-user binary temp1 temp2 cont)
	     nowait)
	    (ange-ftp-add-file-entry newname))

	;; newname wasn't remote.
	(ange-ftp-cf2 t nil newname t-host t-user binary temp1 temp2 cont))

    ;; first copy failed, tell caller
    (ange-ftp-call-cont cont result line)))