From: Fred Cisin <cisin at xenosoft.com>
Worse, on many
systems the answer differs depending what point you
measure at. On most Unix variants, for example, it's 0x0a when
measured in files or in C strings, but 0x0d 0x0a when measured on
hardware serial lines.
in which case, what characters would
fprintf(PRN, "%s" , "X\n" );
actually send to the printer?
Unix was the first ASCII-using OS that I saw that used a print
control character "\n" as a logical separator. Prior to that, I'd
seen decimal 31 (US) used. The benefit of using the ASCII separator
characters (US RS GS FS) is that one can stucture a file or files
hierarchically (i.e. units in records in groups in files). A shame
that our current modern systems don't take advantage of this.
Even CDC SCOPE or NOS allowed for file/record-level hierarchies. Up
to 15 levels of records were allowed, IIRC. So you could skip to the
next level 4 record within a file, bypassing all intervening level 0,
1, 2 and 3 records in the process. A shame that was never carried
into our "modern" systems.
Does anyone know why SUB (0x1A, 26) was used to denote an EOF in CP/M
and, to some extent, DOS text files?
IIRC, there is at least one programming language that treats newline
as a quotable character.
Cheers,
Chuck