iolispiostreaminterlisp

Write text I/O stream to file with Interlisp Medley


I am tring to write text stream to file in Interlisp, Medley. I have searched everywhere (onine and in the books) but could not find a feasible command for I/O stream file operation in Interlisp.

Thanks to @ignis volens 's answers, I found the following solution, but I still haven't successfully print to file yet, the code I use is as follows:

(SETQ S (OPENSTREAM 'output.TEDIT 'OUTPUT))
> <OUTPUT stream ...>
(PRIN1 'lalala S)
> lalala      
(GETFILEINFO 'output.TEDIT 'PROTECTION)
> 33188  

it didn't report errors, but the file 'output.TEDIT' has nothing in it, the text 'lalala' has not been printed in file as expected. And the PROTECTION returns a string, what is that measn? I have not find any answers so far.

I also tried this:

(SETQ N (OPENFILE 'n.TEDIT 'OUTPUT))
> {DSK}...
(PRIN1 'lalala N)
> LITATOM 'streams' no longer supported
{DSK}...

Solution

  • I got the following response from Larry Masinter for you:


    The problem is these are buffered streams and there is no background task of writing out the bytes. So you won't see the lalala until you call (FLUWHOUTPUT S) or close the stream.