comp.lang.ada
 help / color / mirror / Atom feed
* Re: Unbuffered Keyboard I/O
       [not found] <1995Feb3.071931.1@clstcs>
@ 1995-02-06 14:19 ` Do-While Jones
  1995-02-08 15:38 ` Theodore E. Dennison
  1 sibling, 0 replies; 2+ messages in thread
From: Do-While Jones @ 1995-02-06 14:19 UTC (permalink / raw)


> 
> I posted earlier about unbuffered keyboard io, well it works really well (i
> used the one at owens.ridgecrest.ca.us) but when the package initializes itself
> it must screw with the i/o channels some how because the PUT statement does not
> work but all the others like PUT_LINE and NEW_LINE work... PUT actually will
> show up after a PUT_LINE or a NEW_LINE or quitting the program... anyone have
> any ideas on how to fix this?  Thanx in advance
> 
> 
In general, unbuffered I/O DOES change the configuration of the I/O 
interface.  This is especially true of the UNIX and MPX-32 operating 
systems.  As a result, you can't mix your own unbuffered I/O with 
buffered I/O via TEXT_IO.  Furthermore, you have to be sure to restore 
the original I/O parameters before you end your program, or else your 
responses to the command line won't echo any more!  You have to know what 
you are doing if you are going to do unbuffered I/O.


-- 
            +--------------------------------+
            |    Know                 Ada    |
            |        [Ada's Portrait]        |
            |    Will              Travel    |
            | wire do_while@ridgecrest.ca.us |
            +--------------------------------+



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Unbuffered Keyboard I/O
       [not found] <1995Feb3.071931.1@clstcs>
  1995-02-06 14:19 ` Unbuffered Keyboard I/O Do-While Jones
@ 1995-02-08 15:38 ` Theodore E. Dennison
  1 sibling, 0 replies; 2+ messages in thread
From: Theodore E. Dennison @ 1995-02-08 15:38 UTC (permalink / raw)


amlombardi@vms4.sci.csupomona.edu wrote:
>
> I posted earlier about unbuffered keyboard io, well it works really well (i
> used the one at owens.ridgecrest.ca.us) but when the package initializes itself
> it must screw with the i/o channels some how because the PUT statement does not
> work but all the others like PUT_LINE and NE~W_LINE work... PUT actually will
> show up after a PUT_LINE or a NE~W_LINE or quitting the program... anyone have
> any ideas on how to fix this?  Thanx in advance

Actually, this is quite common behavior for PUT. On many systems, PUT
I/Os are buffered, and only PUT_LINEs and NEW_LINEs flush that buffer.

In many OS's (VMS for one) exitting a program automaticly flushes all
I/O buffers.

I know VAX Ada exihibts this behavior. There may be other Ada's that 
do it as well.

The solution to this in VMS is to either 
  - Use PUT_LINE or NEW_LINE when the text absolutely HAS to be
    displayed.
  - Use the SMG package instead of Text_IO
  - Use QIOs (YUUUUCK!)
  - Use the FORM parameter when you open the text file to get Text_IO
    to not buffer any writes (I hope you are an RMS expert!)

If you ARE using VAX Ada, I suggest SMG.

T.E.D.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1995-02-08 15:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1995Feb3.071931.1@clstcs>
1995-02-06 14:19 ` Unbuffered Keyboard I/O Do-While Jones
1995-02-08 15:38 ` Theodore E. Dennison

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox