;;; -*- Mode:Lisp; Readtable:CL; Package:USER; Base:10; Patch-File:T -*-
;;; Patch file for System version 123.97
;;; Reason:
;;;  Once User FTP has set a transfer mode, it sticks.  Therefore, don't send over
;;;  commands to enter a mode we are already in.
;;; Written 4-Nov-87 19:30:58 by pld at site LMI Cambridge
;;; while running on Jack Flanders from band 2
;;; with Experimental System 123.96, Experimental Local-File 73.0, Experimental FILE-Server 22.0, Experimental Unix-Interface 11.0, Experimental Tape 18.0, Experimental KERMIT 34.0, Experimental ZMail 71.0, Experimental Lambda-Diag 15.0, microcode 1754, SDU Boot Tape 3.12, SDU ROM 8.



; From modified file DJ: L.NETWORK.IP-TCP.USER; FTP.LISP#39 at 4-Nov-87 19:30:59
#10R FTP#: 
(COMPILER-LET ((*PACKAGE* (GLOBAL:PKG-FIND-PACKAGE "FTP")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; USER; FTP  "

(defmacro setopt (opt-sym opt &rest args)
  `(cond ((eq ,opt-sym ,opt) ,opt)
	 ((commandp (sym complete) (get ,opt :defopt-fmt) ,@args)
	  (setq ,opt-sym ,opt))
	 (t nil)))

))

; From modified file DJ: L.NETWORK.IP-TCP.USER; FTP.LISP#39 at 4-Nov-87 19:31:44
#10R FTP#: 
(COMPILER-LET ((*PACKAGE* (GLOBAL:PKG-FIND-PACKAGE "FTP")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; USER; FTP  "

(defcmd cmd-ascii () t
  "set ascii transfer type"
  (setopt *type* 'ascii))

))

; From modified file DJ: L.NETWORK.IP-TCP.USER; FTP.LISP#39 at 4-Nov-87 19:31:54
#10R FTP#: 
(COMPILER-LET ((*PACKAGE* (GLOBAL:PKG-FIND-PACKAGE "FTP")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; USER; FTP  "

(defcmd cmd-binary () t
  "set binary transfer type"
  (setopt *type* 'binary))

))

; From modified file DJ: L.NETWORK.IP-TCP.USER; FTP.LISP#39 at 4-Nov-87 19:31:59
#10R FTP#: 
(COMPILER-LET ((*PACKAGE* (GLOBAL:PKG-FIND-PACKAGE "FTP")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; USER; FTP  "

(defcmd cmd-image () t
  "set image transfer type"
  (setopt *type* 'image))

))

; From modified file DJ: L.NETWORK.IP-TCP.USER; FTP.LISP#39 at 4-Nov-87 19:32:03
#10R FTP#: 
(COMPILER-LET ((*PACKAGE* (GLOBAL:PKG-FIND-PACKAGE "FTP")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; USER; FTP  "

(defcmd cmd-ebcdic () t
  "set ebcdic transfer type"
  (setopt *type* 'ebcdic))

))

; From modified file DJ: L.NETWORK.IP-TCP.USER; FTP.LISP#39 at 4-Nov-87 19:32:07
#10R FTP#: 
(COMPILER-LET ((*PACKAGE* (GLOBAL:PKG-FIND-PACKAGE "FTP")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; USER; FTP  "

(defcmd cmd-tenex () t
  "set tenex transfer type"
  (setopt *type* 'tenex *bytesize*))

))

; From modified file DJ: L.NETWORK.IP-TCP.USER; FTP.LISP#39 at 4-Nov-87 19:32:11
#10R FTP#: 
(COMPILER-LET ((*PACKAGE* (GLOBAL:PKG-FIND-PACKAGE "FTP")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; USER; FTP  "

(defcmd cmd-16bit () t
  "set 16bit transfer type"
  (unless (setopt *type* '16bit)
    (setopt *type* 'binary)))

))

; From modified file DJ: L.NETWORK.IP-TCP.USER; FTP.LISP#39 at 4-Nov-87 19:32:18
#10R FTP#: 
(COMPILER-LET ((*PACKAGE* (GLOBAL:PKG-FIND-PACKAGE "FTP")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; USER; FTP  "

(defcmd cmd-non-print () t
  "set non-print transfer format"
  (setopt *form* 'non-print))

))

; From modified file DJ: L.NETWORK.IP-TCP.USER; FTP.LISP#39 at 4-Nov-87 19:32:21
#10R FTP#: 
(COMPILER-LET ((*PACKAGE* (GLOBAL:PKG-FIND-PACKAGE "FTP")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; USER; FTP  "

(defcmd cmd-telnet () t
  "set telnet transfer format"
  (setopt *form* 'telnet))

))

; From modified file DJ: L.NETWORK.IP-TCP.USER; FTP.LISP#39 at 4-Nov-87 19:32:28
#10R FTP#: 
(COMPILER-LET ((*PACKAGE* (GLOBAL:PKG-FIND-PACKAGE "FTP")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; USER; FTP  "

(defcmd cmd-carriage-control () t
  "set carriage-control transfer format"
  (setopt *form* 'carriage-control))

))

; From modified file DJ: L.NETWORK.IP-TCP.USER; FTP.LISP#39 at 4-Nov-87 19:32:38
#10R FTP#: 
(COMPILER-LET ((*PACKAGE* (GLOBAL:PKG-FIND-PACKAGE "FTP")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; USER; FTP  "

(defcmd cmd-file () t
  "set file transfer structure"
  (setopt *struct* 'file))

))

; From modified file DJ: L.NETWORK.IP-TCP.USER; FTP.LISP#39 at 4-Nov-87 19:32:42
#10R FTP#: 
(COMPILER-LET ((*PACKAGE* (GLOBAL:PKG-FIND-PACKAGE "FTP")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; USER; FTP  "

(defcmd cmd-record () t
  "set record transfer structure"
  (setopt *struct* 'record))

))

; From modified file DJ: L.NETWORK.IP-TCP.USER; FTP.LISP#39 at 4-Nov-87 19:32:47
#10R FTP#: 
(COMPILER-LET ((*PACKAGE* (GLOBAL:PKG-FIND-PACKAGE "FTP")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; USER; FTP  "

(defcmd cmd-page () t
  "set page transfer structure"
  (setopt *struct* 'page))

))

; From modified file DJ: L.NETWORK.IP-TCP.USER; FTP.LISP#39 at 4-Nov-87 19:32:54
#10R FTP#: 
(COMPILER-LET ((*PACKAGE* (GLOBAL:PKG-FIND-PACKAGE "FTP")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; USER; FTP  "

(defcmd cmd-stream () t
  "set stream transfer mode"
  (setopt *mode* 'stream))

))

; From modified file DJ: L.NETWORK.IP-TCP.USER; FTP.LISP#39 at 4-Nov-87 19:32:57
#10R FTP#: 
(COMPILER-LET ((*PACKAGE* (GLOBAL:PKG-FIND-PACKAGE "FTP")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; USER; FTP  "

(defcmd cmd-block () t
  "set block transfer mode"
  (setopt *mode* 'block))

))

; From modified file DJ: L.NETWORK.IP-TCP.USER; FTP.LISP#39 at 4-Nov-87 19:33:00
#10R FTP#: 
(COMPILER-LET ((*PACKAGE* (GLOBAL:PKG-FIND-PACKAGE "FTP")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; USER; FTP  "

(defcmd cmd-compressed () t
  "set compressed transfer mode"
  (setopt *mode* 'compressed))

))

; From modified file DJ: L.NETWORK.IP-TCP.USER; FTP.LISP#39 at 4-Nov-87 19:33:57
#10R FTP#: 
(COMPILER-LET ((*PACKAGE* (GLOBAL:PKG-FIND-PACKAGE "FTP")))
  (COMPILER::PATCH-SOURCE-FILE "SYS: NETWORK; IP-TCP; USER; FTP  "

(defcmd (cmd-ls cmd-dir) (&optional remote-directory local-file) t
  "list contents of remote directory"
  (cmd-ascii)
  (recvrequest "LIST" local-file remote-directory))

))
