Number: 192

Date: 19-Mar-84 17':22':11

Submitter: Sannella.PA

Source: MASINTER.PA

Subject: (CLOSEF display-stream) should be no-op 

Lisp Version: 

Description: '
Date': 18 MAR 84 23':28 PST'
From': MASINTER.PA'
Subject': non-closable streams'
To':   LispCore↑'
'
There are some streams, (e.g., T) for which CLOSEF is basically a no-op. '
'
For streams which connect you to file servers or to disk files, there is some sense in making closing the stream flush the cache, close the connection, etc. '
'
For other streams, e.g., RS232, string streams, NODIRCORE, it might be preferable to make CLOSEF be a no-op. At least, that would prevent the problem of figuring out how to reopen the thing. '
'
Shouldn''t CLOSEF on a display stream be a no-op? '
'
It seemed pretty clear tht CLOSEF on the more hardware-device kinds of things like RS232 and the keyboard stream should just leave the thing alone.'
'
(This is a ''design discussion'', because I have no current instances of something that doesn''t work because of the current system design. I do recall some incident where I got into trouble by closing the RS232 stream and not knowing how to reopen it, but I don''t recall the details.)'
'
-----'
'
Date': 18 MAR 84 23':29 PST'
From': MASINTER.PA'
Subject': USERCLOSABLE etc.'
To':   kaplan'
cc':   lispcore↑'
'
Maybe it would help to focus this design discussion in the ImplManual in the section on what the various STREAM fields mean. I don''t understand USERCLOSEABLE, for example.'
'
-----'
'
From': KAPLAN.pa'
Date': 19-Mar-84  0':06':02 PST'
Subject': Re': non-closable streams'
In-reply-to': MASINTER, Lispsupport'
''s message of 18 MAR 84 23':28 PST'
To': MASINTER'
cc': LispCore↑'
'
You have to be able to do a CLOSEF on a stream if you want to re-open it with difference access mode.  For some streams, like display streams or T, it doesn''t make sense to change the access mode, hence CLOSEF might just as well be a no-op.'
'
Indeed, display streams probably should be marked as not closeable, since the world gets fairly confused if, e.g., you do CLOSEF to a window':  the window stays around but you can''t print to it cause its stream is closed.  One thought I had about this was to make CLOSEF of a window also do a CLOSEW.  But maybe it is better just not to close the stream.'
'
I guess this latter point is an AR.'
'
--Ron'
'
-----'
'
Date': 19 MAR 84 17':58 PST'
From': JONL.PA'
Subject': Re': non-closable streams'
To':   MASINTER, LispCore↑'
cc':   JONL'
'
In response to the message sent  18 MAR 84 23':28 PST from MASINTER.PA'
'
Well, the RS232 stream is in fact a prime candidate for a CLOSEF method.'
I haven''t added a functional interface (should probably do so) to "shut'
down the hardware", but the device eventfn does indeed do the shut-down'
at makesys and sysout time ["shutdown" could only mean dropping the DTR'
and CTS lines on the Dolphin, but it implies a bit more on the DLion].'
'
The RS232 documentation doesn''t describe all this yet because I don''t'
think I''ve gotten it 100% "right".  The driver code of post January'
is a lot better at not barfing when you try CLOSEF on the rs232 stream.'
'
-----'
'
Date': 19 Mar 84 18':28 PST'
From': Masinter.pa'
Subject': Re': non-closable streams'
In-reply-to': JONL.PA''s message of 19 MAR 84 17':58 PST'
To': JONL.PA'
cc': Lichtenberg.wbst, LispCore↑.PA'
'
the inconsistency that I ran across (I think) was that you didn''t OPENSTREAM({RS232}) to initialize it. Thus, once I had closed the stream, I had no way of reopening it.'
'
On my little TRS-80 model 100, they support RS232 by making you open a stream on the device, and using the file name to give the paramters.  That might be a good model for how to run RS232 in Interlisp-D. Translating it into Interlisp-ese, this would say':'
'
stream←(OPENSTREAM ''{RS232}1200.XON ''BOTH) would (a) initialize the hardware (instead of RS232INIT), and create the open stream. (On the Radio Shack one the "name" was a more terse code which encoded baud rate, whether Xon/Xoff was enabled, number of stop-bits, parity, etc.  For all I know, it is industry or at least MicroSoft standard.)'
'
Attempting to OPENSTREAM an RS232 stream when one is already open could generate a FILE WONT OPEN error. '
'
[In general, the design principle is that if there are "generic" functions which map reasonably into the device-specific ones, they should be used rather than special purpose ones. For example, GETFILEINFO and SETFILEINFO can be used for setting up various parameters of streams where possible if they don''t fit into other file operations; loading extra information into the file name is reasonable and done in almost all operating systems.]'
'
'
-----'
'
Date': 19 Mar 84 19':36 PST'
From': Masinter.pa'
Subject': Re': non-closable streams'
In-reply-to': KAPLAN.pa''s message of 19-Mar-84  0':06':02 PST'
To': KAPLAN.pa'
cc': MASINTER.pa, LispCore↑.pa'
'
The latter point may be an AR, but what is the AR? What Action are you Requesting? (and Impact, etc.).'
'
(CLOSEF window) => (CLOSEW window)? Or Illegal operation? or no-op?'
'
CLOSEW and CLOSEF aren''t really the same. If we had a CLOSEW which somehow cleared out any space hung onto by the window (e.g., deallocated the saved-bitmap), maybe CLOSEF would be the analog, but otherwise'
'
(CLOSEW window) = (SETFILEINFO window ''VISIBLE NIL) or some such.'
'
'
-----'
'
From': kaplan.pa'
Date': 19-Mar-84 22':43':26 PST'
Subject': Re': non-closable streams'
In-reply-to': Masinter''s message of 19 Mar 84 19':36 PST'
To': Masinter'
cc': KAPLAN, LispCore↑'
'
The simplest action is to make display streams not be usercloseable--which means that they will be marked as access=OUTPUT until they are collected.  Thus (CLOSEF window) is a no-op.  '
'
This maintains integrity, and means, for example, that you could SEE a file to a window without having the window''s stream getting smashed at the end.'
'
It is tempting to map CLOSEF into CLOSEW, taking a very general notion of closing an object.  But I don''t think that has useful applications.'
'
So the AR is':  make display streams not be usercloseable.'
'
--Ron'
'
-----'
'
Date': 20 Mar 84 19':55 PST'
From': Kaplan.pa'
Subject': AR 202':  closing T'
To': Lispsupport'
'
Fixed.  CLOSEF on all display streams is now a no-op.'
'
But':  looking at the code, I don''t see how what Nuyens described could have happened.  CLOSEF already had a special check in it to make sure that it didn''t close T.'
'
'


Workaround: 

Test Case: 

Edit-By: Sannella.PA

Edit-Date: 17-Aug-84 10':16':26

Attn: 

Assigned To: Kaplan.pa

In/By: 

Disposition: 

System: Operating System

Subsystem: Generic File Operations

Machine: 

Disk: 

Microcode Version: 

Memory Size: 

File Server: 

Server Software Version: 

Difficulty: 

Frequency: Intermittent

Impact: Minor

Priority: Perhaps

Status: Closed

Problem Type: Design - Impl

Source Files: