RISC OS line termination

Tony van der Hoff tony at mk-net.demon.co.uk
Thu Jan 24 16:56:31 GMT 2002


On 24 Jan 2002, in message <9e25eafd4a.peter at moo.chocky.org>,
Peter Naulls <peter at chocky.org> wrote:

> In message <Pine.LNX.4.33.0201241515350.24475-100000 at ugnode2.ecs.soton.ac.uk>
>           Alex Waugh <ajw498 at ecs.soton.ac.uk> wrote:
> 
> > On Thu, 24 Jan 2002, Peter Naulls wrote:
> > 
> > > What order does Unix use when it needs to output both? (if it's
> > > consistent).
> > 
> > I don't know. Does it ever output both?
> 
> The existence of various flags on the tcsetattr man page suggests that
> they would have to.
> 

FWIW, and I hope I'm not attempting to teach any grandmothers out there how
to suck eggs, historically it's always been <cr><lf>. It is *not*, as was
suggested elsewhere, a DOS-ism, it was necessary long before Bill Gates was
out of nappies, DOS simply carried it through.

In the seventies, when the OS which evolved into Unix first saw the light of
day, the system terminals were teleprinters, and later DecWriters. The time
taken for a carriage was about twice as long as the serial character period
(at 10 chars/sec). Therefore the EOL sequence was <cr><lf>, taking advantage
of the <lf> as a padding character. If that was not done, the first character
of the new line was printed during the flyback period of the print head. 

When VDUs became popular, the need for this disappeared, but AFAIK, the
<cr><lf> sequence was retained for tty compatibility. some tty drivers may
have dropped the <cr> for efficiency reasons, but it certainly *used* to
always output both. Peter's comment suggests that formally it still does.

-- 
Tony van der Hoff         | MailTo:tony at mk-net.demon.co.uk
                          | MailTo:avanderhoff at iee.org
Buckinghamshire, England  | http:www.mk-net.demon.co.uk



More information about the gcc mailing list