home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!uvaarpa!concert!ais.com!bruce
- From: bruce@ais.com (Bruce C. Wright)
- Newsgroups: comp.os.vms
- Subject: Re: The problem with $CREMBX System_Service
- Message-ID: <1992Nov19.093226.5845@ais.com>
- Date: 19 Nov 92 09:32:26 GMT
- References: <14709.2b092769@ohstpy.mps.ohio-state.edu>,<1992Nov18.171216.26136@nntpd2.cxo.dec.com> <1eevvpINNhgv@gap.caltech.edu>
- Distribution: world
- Organization: Applied Information Systems, Chapel Hill, NC
- Lines: 39
-
- In article <1eevvpINNhgv@gap.caltech.edu>, carl@SOL1.GPS.CALTECH.EDU (Carl J Lydick) writes:
- > In article <1992Nov18.171216.26136@nntpd2.cxo.dec.com>, winalski@adserv.enet.dec.com (Paul S. Winalski) writes:
- > =
- > =The DCL command interpreter uses RMS to read its input file. RMS is a
- > =record-oriented I/O system. [...]
- >
- > The fault is not in RMS. MAILBOXES ARE RECORD-ORIENTED DEVICES. You can't
- > read a single character from a mailbox (well, you CAN, by using $QIO[W], but
- > the only character you can read singly is the first character of a record,
- > and then you lose the rest of the record).
- >
- > =The solution is to buffer characters inside your program until you read a
- > =CR from the terminal, then write the buffered string (not including the CR)
- > =to the mailbox using one $QIO.
- >
- > Or have the application that's reading the mailbox buffer what it reads until
- > it sees a CR in the data its reading from the mailbox. Both techniques are
- > equally effective, and I'd choose the one for which obtaining and modifying
- > the source code is easier.
-
- Another solution, which may be more like what the original author was
- looking for, would be to use the pseudoterminal driver (either the FTA
- driver or the PY/TW drivers depending on VMS version and/or convenience).
- It wasn't entirely clear to me whether the applications were all newly-
- written applications or not; and in any event, from the point of view
- of the consumer application, a pseudo-terminal is (nearly) indistinguish-
- able from a real terminal, so even if it isn't newly-written it would
- probably be very easy to make it run on a pseudo-terminal.
-
- You can often use mailboxes for this sort of thing, but as Carl points
- out there are problems because of the record-oriented nature of mailbox
- I/O. But the pseudoterminal drivers are true stream-oriented devices
- that allow you to do single-character I/O in the manner that the original
- author was expecting the mailbox driver to operate. They're both useful
- devices, but in general mailboxes are more useful for sending highly
- structured messages, and pseudoterminals are more useful for capturing
- terminal-like I/O streams.
-
- Bruce C. Wright
-