[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Issue: CLOSED-STREAM-OPERATIONS (version 3)



Status: DRAFT
Issue:        CLOSED-STREAM-OPERATIONS
References:   CLOSE (CLtL p 332)
Category:     CLARIFICATION
Edit history: 26-Aug-88, Version 1 by Chapman
               8-Oct-88, Version 2 by Masinter
              13-Oct-88, Version 3 by van Roggen
 
Related Issues: STREAM-ACCESS, STREAM-INFO
 
 
Problem Description:
 
The description of CLOSE is not completely clear about the functions
which are allowed to be performed on a closed stream.
 
On p332 it says:
	"The stream is closed. No further Input/output operations may be
	performed on it. However, certain inquiry operations may still
	be performed, ..."
but the list of inquiry operations is not specified.
 
At least one implementation interpreted the list to include
at least OUTPUT-STREAM-P, while another has disallowed that operation
to be performed on a closed stream. 

 
Proposal (CLOSED-STREAM-FUNCTIONS:ALLOW-INQUIRY)
 
Clarify that one may call the following functions on closed streams without
error due to the stream being closed:

  STREAMP, INPUT-STREAM-P, OUTPUT-STREAM-P, CLOSE, PATHNAME, TRUENAME,
  MERGE-PATHNAMES, PATHNAME-HOST, PATHNAME-DEVICE, PATHNAME-DIRECTORY,
  PATHNAME-NAME, PATHNAME-TYPE, PATHNAME-VERSION, NAMESTRING, FILE-NAMESTRING,
  DIRECTORY-NAMESTRING, HOST-NAMESTRING, ENOUGH-NAMESTRING, OPEN,
  PROBE-FILE, DIRECTORY

If proposal STREAM-ACCESS:PROVIDE is adopted, all of its functions will work
on closed streams.

If proposal STREAM-INFO:ONE-DIMENSIONAL-FUNCTIONS is adopted, none of its
functions are required to work on closed streams.
 
Rationale:
 
One can consider many characteristics of a stream to be independent of
the ability to do I/O.  Being able to determine a stream's direction and
its name is often useful for debugging.  A number of the descriptions in
CLtL imply (weakly) the ability to work on closed streams.  Functions
such as OPEN and DIRECTORY don't really depend on the stream, but on
the name of the stream.
 
Current Practice:
 
At least two implementations differ in which functions are allowed to be
performed on a closed stream.
 
Cost to Implementors:
 
Unknown, but likely to be small in most implementations.  A nontrivial
amount of work may be necessary if the pathname information is held
externally and is normally deleted when the stream is closed.  The
implementation will have to copy the information at some time for later
inquiries.

Cost to Users:

None.
 
Benefits:
 
This clarification will assist users in writing portable code.
 
Aesthetics:
 
Yes.
 
Discussion:

There are some separate, but related, issues regarding what CLOSE should
do on composite streams or constructed streams.