[... C] treats IO as streams, which was influenced by UNIX, because this
model makes sense on a UNIX box.
True -- and historically C and Unix were closely interdeveloped (if
you know what I mean). So I can't debate that C makes sense on Unix;
however, don't most post-Cobol languages use stream I/O, even those
primarily developed on non-Unix systems?
PL/I has both record-oriented binary I/O and effectively-stream
character I/O. (As Fortran sort of does, and to a first approximation
PL/I includes everything in Fortran and COBOL plus more.)
Classical BASIC is mostly line-oriented, although the micro/PC BASICs
mostly had (have?) screen-oriented extensions. I think SNOBOL was
line-oriented, but those memories are *really* fuzzy. awk, if you
consider it a programming language, is normally line-oriented.
Pascal and Ada do text I/O as character streams broken into
lines/records and pages, but by (notionally) out-of-band signals
rather than reserved characters. And also, but probably less often,
raw I/O that may be record-oriented.
Trivially, assembler normally provides only whatever the OS does, so
on record-oriented OSes like OS/360 et seq it's record-oriented; on
(mostly) stream-oriented OSes like Unix it's stream-oriented; on
(sometimes) character-oriented OSes like MSDOS or TOPS etc.
Wait. Don't answer that. I just remembered that whether C makes
sense or not, that doesn't affect its portability to non-Unix systems.
So it's a moot point.
Too late <G>. I assume you meant here "whether the C (stream) I/O
model makes sense on non-Unix systems". It does affect portability in
that it may be too difficult to implement C I/O on some system and
thus there will not be a (conforming) implementation at all; but if
there is, standard code will be portable to it. Modulo resource limits
and the weasel wording, as always.
- David.Thompson1 at worldnet.att.net