(DEFINE-FILE-INFO READTABLE "XCL" PACKAGE "INTERLISP")
(FILECREATED "18-May-88 18:57:45" {PHYLUM}<LISP>LYRIC>PATCHES>GETFILEINFOPATCH.\;1 2299   

      |changes| |to:|  (VARS GETFILEINFOPATCHCOMS))


; Copyright (c) 1988 by Xerox Corporation.  All rights reserved.

(PRETTYCOMPRINT GETFILEINFOPATCHCOMS)

(RPAQQ GETFILEINFOPATCHCOMS ((FNS \\LEAF.GETFILEINFO)))
(DEFINEQ

(\\LEAF.GETFILEINFO
  (LAMBDA (STREAM ATTRIBUTE DEV)                             (* \; "Edited  7-Jan-88 14:44 by bvm:")

    (COND
       ((|type?| STREAM STREAM)                              (* \; "Handle open case easily")

        (\\LEAF.GETFILEINFO.OPEN STREAM ATTRIBUTE))
       (T (PROG (DEVINFO SEQUIN RESULT)
                (COND
                   ((FMEMB ATTRIBUTE '(CREATIONDATE ICREATIONDATE))
          
          (* |;;| "Use the LOOKUPFILE protocol.  Would like to have LENGTH here, too, but might disagree with Leaf due to race conditions;  e.g.  LENGTH of a file that I just had closed could get an old length")

                    (COND
                       ((AND (SETQ SEQUIN (|fetch| PFSLEAFSEQUIN |of| (SETQ DEVINFO
                                                                       (|fetch| DEVICEINFO
                                                                          |of| DEV))))
                             (SETQ RESULT (|fetch| LEAFCACHEDFILE |of| SEQUIN))
                             (EQ (|fetch| FULLFILENAME |of| RESULT)
                                 STREAM))                    (* \; "A name we know about")

                        (RETURN (\\LEAF.GETFILEINFO.OPEN RESULT ATTRIBUTE)))
                       ((NEQ (SETQ RESULT (\\IFS.LOOKUPFILE STREAM 'OLD ATTRIBUTE DEVINFO))
                             '?)
                        (RETURN RESULT)))))
          
          (* |;;| "To get attributes, have to open file, read them, then close.")

                (RETURN (COND
                           ((SETQ STREAM (\\LEAF.GETFILE DEV STREAM 'NONE 'OLD))
                            (PROG1 (\\LEAF.GETFILEINFO.OPEN STREAM ATTRIBUTE)
                                   (\\LEAF.CLOSEFILE STREAM T))))))))))
)
(PUTPROPS GETFILEINFOPATCH COPYRIGHT ("Xerox Corporation" 1988))
(DECLARE\: DONTCOPY
  (FILEMAP (NIL (374 2211 (\\LEAF.GETFILEINFO 384 . 2209)))))
STOP