Function: ange-ftp-set-ascii-mode

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

Signature

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

Documentation

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

Source Code

;; Defined in /usr/src/emacs/lisp/net/ange-ftp.el.gz
(defun ange-ftp-set-ascii-mode (host user)
  "Tell the FTP process for the given HOST & USER to switch to ASCII 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 "ascii"))))
    (if (not (car result))
	(ange-ftp-error host user (concat "ASCII failed: " (cdr result)))
      (with-current-buffer (process-buffer (ange-ftp-get-process host user))
	(and ange-ftp-ascii-hash-mark-size
	     (setq ange-ftp-hash-mark-unit
		   (ash ange-ftp-ascii-hash-mark-size -4)))))))