Specifying tty delimiter characters

John Gilmore gnu at hoptoad.uucp
Wed May 11 13:55:04 AEST 1988


wcs at skep2.ATT.COM (Bill.Stewart.<ho95c>) wrote:
> One feature I've wished was available in a TTY driver is the ability to
> specify a bunch of characters (e.g. control characters), and tell it
> to "read until N input characters or a special character".

The Data General AOS system implemented this uniformly across the file
system.  If you did "data sensitive" reads, it would read up to a delimiter
and just return you that much.  This was true of files as well as devices.
You could default the delimiter table (to CR, NL, FF, NUL, etc) or specify
it, as a 256-bit table.  The data-sensitive mode could be specified at
open time, or on individual reads.

On a Unix system, I suspect that the right place to make this pervasive
is in standard I/O.  On disk files, it would itself scan for the
delimiters; on ttys on old Unix systems, it would do raw mode reads; on
ttys on enhanced Unix systems, it could pass the delimiter table to the
kernel and let it terminate a longer, less resource-ful read.  You'd
need to define and implement a couple of new stdio functions for "read
up to delimiter", "set delimiter table", and "write up to delimiter".
Then wait til enough people use them so that the kernels can be
improved to deal.
-- 
John Gilmore  {sun,pacbell,uunet,pyramid,ihnp4}!hoptoad!gnu        gnu at toad.com
"Use the Source, Luke...."



More information about the Comp.unix.wizards mailing list