Function: dun-send

dun-send is a byte-compiled function defined in dunnet.el.gz.

Signature

(dun-send ARGS)

Source Code

;; Defined in /usr/src/emacs/lisp/play/dunnet.el.gz
(defun dun-send (args)
  (if (not (car args))
      (dun-mprincl "Usage: send <filename>")
    (setq args (car args))
    (let (counter foo)
      (setq foo nil)
      (setq counter 0)

;;; User can send commands!  Stupid user.


      (if (assq (intern args) dun-unix-verbs)
	  (progn
	    (rplaca (assq (intern args) dun-unix-verbs) 'IMPOSSIBLE)
	    (dun-mprinc "Sending ")
	    (dun-mprinc dun-ftptype)
	    (dun-mprinc " file for ")
	    (dun-mprincl args)
	    (dun-mprincl "Transfer complete."))

	(dolist (x dun-objfiles)
	  (if (string= args x)
	      (progn
		(if (not (member counter dun-inventory))
		    (progn
		      (dun-mprincl "No such file.")
		      (setq foo t))
		  (dun-mprinc "Sending ")
		  (dun-mprinc dun-ftptype)
		  (dun-mprinc " file for ")
		  (dun-mprinc (downcase (cadr (nth counter dun-objects))))
		  (dun-mprincl ", (0 bytes)")
		  (if (not (eq dun-ftptype 'binary))
		      (progn
			(if (not (member obj-protoplasm
					 (nth receiving-room
					      dun-room-objects)))
			    (dun-replace dun-room-objects receiving-room
				     (append (nth receiving-room
						  dun-room-objects)
					     (list obj-protoplasm))))
			(dun-remove-obj-from-inven counter))
		    (dun-remove-obj-from-inven counter)
		    (dun-replace dun-room-objects receiving-room
			     (append (nth receiving-room dun-room-objects)
				     (list counter))))
		  (setq foo t)
		  (dun-mprincl "Transfer complete."))))
	  (setq counter (+ 1 counter)))
	(if (not foo)
	    (dun-mprincl "No such file."))))))