Function: ange-ftp-set-binary-mode

ange-ftp-set-binary-mode is a byte-compiled function defined in ange-ftp.el.gz.

Signature

(ange-ftp-set-binary-mode HOST USER)

Documentation

Tell the FTP process for the given HOST & USER to switch to binary mode.

Source Code

;; Defined in /usr/src/emacs/lisp/net/ange-ftp.el.gz
;;;; ------------------------------------------------------------
;;;; File transfer mode support.
;;;; ------------------------------------------------------------

(defun ange-ftp-set-binary-mode (host user)
  "Tell the FTP process for the given HOST & USER to switch to binary mode."
  ;; FIXME: We should keep track of the current mode, so as to avoid
  ;; unnecessary roundtrips.
  (let ((result (ange-ftp-send-cmd host user '(type "binary"))))
    (if (not (car result))
	(ange-ftp-error host user (concat "BINARY failed: " (cdr result)))
      (with-current-buffer (process-buffer (ange-ftp-get-process host user))
	(and ange-ftp-binary-hash-mark-size
	     (setq ange-ftp-hash-mark-unit
		   (ash ange-ftp-binary-hash-mark-size -4)))))))