(FILECREATED "31-Dec-85 10:55:58" {ERIS}<LISPCORE>SOURCES>FLOPPYRENAMEFILEPATCH.;1 2373   

      changes to:  (VARS FLOPPYRENAMEFILEPATCHCOMS))


(* Copyright (c) 1985 by Xerox Corporation. All rights reserved.)

(PRETTYCOMPRINT FLOPPYRENAMEFILEPATCHCOMS)

(RPAQQ FLOPPYRENAMEFILEPATCHCOMS ((FNS \PFLOPPY.RENAMEFILE)))
(DEFINEQ

(\PFLOPPY.RENAMEFILE
  (LAMBDA (OLDFILE NEWFILE FDEV OLDRECOG NEWRECOG)           (* kbr: "31-Dec-85 10:29")
    (COND
      ((NULL OLDRECOG)
	(SETQ OLDRECOG (QUOTE OLD))))
    (COND
      ((NULL NEWRECOG)
	(SETQ NEWRECOG (QUOTE NEW))))
    (WITH.MONITOR \FLOPPYLOCK (PROG (OLDFILENAME NEWFILENAME PFALLOC PLPAGE FULLFILENAME)
				      (\PFLOPPY.OPEN)
				      (SETQ OLDFILENAME (\FLOPPY.ASSUREFILENAME OLDFILE))
				      (SETQ NEWFILENAME (\FLOPPY.ASSUREFILENAME NEWFILE))
				      (SETQ PFALLOC (\PFLOPPY.DIR.GET OLDFILENAME OLDRECOG))
				      (COND
					((NULL PFALLOC)    (* File not found. *)
                                                             (* Returning NIL means unsuccessful.
							     *)
					  (RETURN NIL)))
				      (\PFLOPPY.DIR.REMOVE PFALLOC)
                                                             (* TBW: If new file name too long.
							     *)
                                                             (* Store NEWFILENAME on PFALLOC.
							     *)
				      (\PFLOPPY.DIR.PUT NEWFILENAME NEWRECOG PFALLOC)
                                                             (* Store NEWFILENAME on PLPAGE.
							     *)
				      (SETQ PLPAGE (fetch (PFALLOC PLPAGE) of PFALLOC))
				      (replace (PLPAGE $NAME) of PLPAGE
					 with (fetch (PFALLOC FILENAME) of PFALLOC))
                                                             (* Write changes onto floppy.
							     *)
				      (\PFLOPPY.WRITEPAGENO (fetch (PFALLOC START) of PFALLOC)
							      PLPAGE)
                                                             (* Return FULLFILENAME. *)
				      (SETQ FULLFILENAME (\FLOPPY.ADDDEVICENAME
					  (fetch (PFALLOC FILENAME) of PFALLOC)))
				      (RETURN FULLFILENAME)))))
)
(PUTPROPS FLOPPYRENAMEFILEPATCH COPYRIGHT ("Xerox Corporation" 1985))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (330 2281 (\PFLOPPY.RENAMEFILE 340 . 2279)))))
STOP