Changeset 243


Ignore:
Timestamp:
08/18/11 13:08:56 (3 years ago)
Author:
rjs
Message:

Version 31.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lisp/lmio/qfile.lisp

    r242 r243  
    901901                    (FUNCALL STREAM-OR-ERROR-MESSAGE ':CLOSE)))))) ;In case this did something
    902902
    903 (DEFUN FILE-CLOSE (IGNORE &AUX PKT SUCCESS STRING FILENAME-ORIGIN)
     903(DEFUN FILE-CLOSE (IGNORE &OPTIONAL ABORTP &AUX PKT SUCCESS STRING FILENAME-ORIGIN)
    904904  (COND ((EQ (CHANNEL-STATE FILE-CHANNEL) ':CLOSED) NIL)
    905905        ((NEQ (CHAOS:STATE (CHANNEL-CONTROL-CONNECTION FILE-CHANNEL)) 'CHAOS:OPEN-STATE)
    906906         (SETF (CHANNEL-STATE FILE-CHANNEL) ':CLOSED)
    907907         T)
    908         (T (AND (EQ (CHANNEL-STATE FILE-CHANNEL) ':OPEN)
    909                 (EQ (CHANNEL-DIRECTION FILE-CHANNEL) ':OUTPUT)
    910                 (FUNCALL (CHANNEL-FUNCTION FILE-CHANNEL) ':EOF))
     908        (T (COND ((AND (EQ (CHANNEL-STATE FILE-CHANNEL) ':OPEN)
     909                       (EQ (CHANNEL-DIRECTION FILE-CHANNEL) ':OUTPUT))
     910                  ;; Closing an open output channel.  Finish sending the data.
     911                  (FUNCALL (CHANNEL-FUNCTION FILE-CHANNEL) ':EOF)
     912                  ;; If aborting out of a file-writing operation before normal :CLOSE,
     913                  ;; delete the incomplete file.  Don't worry if it gets an error.
     914                  (AND (EQ ABORTP ':ABORT)
     915                       (FUNCALL (CHANNEL-FUNCTION FILE-CHANNEL) ':COMMAND NIL "DELETE"))))
    911916           (COND ((CHANNEL-DATA-PACKET FILE-CHANNEL)
    912917                  (FUNCALL (CHANNEL-FUNCTION FILE-CHANNEL) ':RETURN
Note: See TracChangeset for help on using the changeset viewer.