(FILECREATED " 4-Sep-86 15:16:59" {DANTE}<RCLARKE>FTPSERVERPATCH.;3 5867   

      changes to:  (FNS \SFTP.PLIST.FROM.FILE)

      previous date: "31-Dec-00 19:05:31" {DANTE}<RCLARKE>FTPSERVERPATCH.;2)


(* Copyright (c) 1986, 1900 by XEROX Corporation. All rights reserved.)

(PRETTYCOMPRINT FTPSERVERPATCHCOMS)

(RPAQQ FTPSERVERPATCHCOMS ((P (FILESLOAD FTPSERVER))
			     (FNS \SFTP.OPENFILE.FROM.PLIST \SFTP.PLIST.FROM.FILE)))
(FILESLOAD FTPSERVER)
(DEFINEQ

(\SFTP.OPENFILE.FROM.PLIST
  [LAMBDA (PLIST ACCESS OUTS DESIREDPROPS)                   (* rdc "31-Dec-00 17:09")
                                                             (* Opens file from user's PLIST, or answers NO and 
							     returns NIL)
    (PROG (FILE FILENAME PIECES ERROR MYPLIST)
	    (for PAIR in PLIST do (SELECTQ (CAR PAIR)
						   (SERVER-FILENAME (SETQ FILENAME (CADR PAIR)))
						   [DEVICE (push PIECES (QUOTE HOST)
								   (COND
								     ((EQ (NTHCHARCODE
									      (CADR PAIR)
									      -1)
									    (CHARCODE :))
								       (SUBSTRING (CADR PAIR)
										    1 -2))
								     (T (CADR PAIR]
						   (DIRECTORY (push PIECES (QUOTE DIRECTORY)
									(CADR PAIR)))
						   (NAME-BODY (push PIECES (QUOTE BODY)
								      (CADR PAIR)))
						   (VERSION (push PIECES (QUOTE VERSION)
								    (CADR PAIR)))
						   [TYPE (push MYPLIST
								 (LIST (QUOTE TYPE)
									 (MKATOM
									   (U-CASE (CADR PAIR]
						   [CREATIONDATE (push MYPLIST (LIST
									   (QUOTE CREATIONDATE)
									   (CADR PAIR]
						   [CREATION-DATE (push MYPLIST
									  (LIST (QUOTE 
										     CREATIONDATE)
										  (CADR PAIR]
						   [END-OF-LINE-CONVENTION
						     (push MYPLIST (LIST (QUOTE EOLCONVENTION)
									     (U-CASE (CADR PAIR]
						   [EOC (push MYPLIST (LIST (QUOTE 
										    EOLCONVENTION)
										(U-CASE
										  (CADR PAIR]
						   [SIZE (push MYPLIST (LIST (QUOTE LENGTH)
										 (MKATOM
										   (CADR PAIR]
						   NIL))
	    (SETQ FILENAME (COND
		[(NULL FILENAME)
		  (PACKFILENAME (NCONC PIECES (LIST (QUOTE HOST)
							  FTPSERVER.DEFAULT.HOST]
		((NULL (FILENAMEFIELD FILENAME (QUOTE HOST)))
		  (PACKFILENAME (QUOTE HOST)
				  FTPSERVER.DEFAULT.HOST
				  (QUOTE BODY)
				  FILENAME))
		(T FILENAME)))
	    (RETURN (COND
			([NLSETQ (SETQ FILE (COND
				       ((EQ ACCESS (QUOTE ENUMERATE))
					 (SETQ FILENAME (DIRECTORY.FILL.PATTERN FILENAME))
					 (CONS FILENAME (\GENERATEFILES FILENAME DESIREDPROPS)))
				       (T (OPENSTREAM FILENAME ACCESS NIL NIL (CONS (QUOTE
											  SEQUENTIAL)
											MYPLIST]
			  FILE)
			(T (\SFTP.MARK.ERROR OUTS)
			   (.EOC. OUTS)
			   NIL])

(\SFTP.PLIST.FROM.FILE
  [LAMBDA (FILE NEW DESIREDPROPS FILEOPENP GENERATOR)        (* edited: " 4-Sep-86 15:16")
                                                             (* Generates a PLIST from FILE.
							     NEW is true if file is being written anew DESIREDPROPS
							     may restrict what we send)
    (PROG ([PIECES (UNPACKFILENAME.STRING (COND
						((type? STREAM FILE)
						  (FULLNAME FILE))
						(T FILE]
	     INFOFN INFOHANDLE HOST DIR NAME EXT VERSION AUTHOR TYPE PLIST)
	    (COND
	      (GENERATOR (SETQ INFOFN (FUNCTION \GENERATEFILEINFO))
			   (SETQ INFOHANDLE GENERATOR))
	      (T (SETQ INFOFN (FUNCTION GETFILEINFO))
		 (SETQ INFOHANDLE FILE)))
	    (for TAIL on PIECES by (CDDR TAIL) do (SELECTQ (CAR TAIL)
								       (HOST (SETQ HOST
									       (CADR TAIL)))
								       (DIRECTORY (SETQ DIR
										      (CADR TAIL)))
								       (NAME (SETQ NAME
									       (CADR TAIL)))
								       (EXTENSION (SETQ EXT
										    (CADR TAIL)))
								       (VERSION (SETQ VERSION
										  (CADR TAIL)))
								       NIL))
	    [SETQ PLIST (NCONC (.IFDESIRED. SERVER-FILENAME (PACKFILENAME.STRING PIECES))
				   (.IFDESIRED. NAME-BODY (COND
						  (EXT (CONCAT NAME "." EXT))
						  (T NAME)))
				   (.IFDESIRED. VERSION VERSION)
				   (.IFDESIRED. END-OF-LINE-CONVENTION (QUOTE CR))
				   (AND DIR (.IFDESIRED. DIRECTORY DIR))
				   (AND HOST (.IFDESIRED. DEVICE HOST]
	    [COND
	      ((NOT NEW)
		(SETQ PLIST (NCONC PLIST [.IFDESIRED. TYPE (SETQ TYPE
							    (OR (APPLY* INFOFN INFOHANDLE
									    (QUOTE TYPE))
								  (\GETFILETYPE FILE FILEOPENP]
				       (AND (EQ TYPE (QUOTE BINARY))
					      (LIST (LIST (QUOTE BYTE-SIZE)
							      8)))
				       (.IFDESIRED. CREATION-DATE (GETFILEINFO (
									      PACKFILENAME.STRING
										   PIECES)
										 (QUOTE 
										     CREATIONDATE)))
				       (.IFDESIRED. SIZE (GETFILEINFO (PACKFILENAME.STRING PIECES)
									(QUOTE LENGTH)))
				       (.IFDESIRED. WRITE-DATE (GETFILEINFO (PACKFILENAME.STRING
										PIECES)
									      (QUOTE WRITEDATE)))
				       (.IFDESIRED. READ-DATE (GETFILEINFO (PACKFILENAME.STRING
									       PIECES)
									     (QUOTE READDATE)))
				       (.IFDESIRED. SIZE (APPLY* INFOFN INFOHANDLE (QUOTE LENGTH))
						    )
				       (.IFDESIRED. AUTHOR (APPLY* INFOFN INFOHANDLE (QUOTE
								       AUTHOR]
	    (RETURN PLIST])
)
(PUTPROPS FTPSERVERPATCH COPYRIGHT ("XEROX Corporation" 1986 1900))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (463 5777 (\SFTP.OPENFILE.FROM.PLIST 473 . 3044) (\SFTP.PLIST.FROM.FILE 3046 . 5775))))
)
STOP