tml@tik.vtt.fi (Tor Lillqvist) (02/14/91)
In article <7813@exodus.Eng.Sun.COM> tut@cairo.Eng.Sun.COM (Bill "Bill" Tuthill) writes: >The world's three most important operating systems-- Unix, MS-DOS, >and MacOS-- all employ different methods for separating lines from >each other. Unix uses linefeed only, MS-DOS uses carriage return >and linefeed, and MacOS uses carriage return only. > >My question is this: do any standards specify how lines should be >kept apart? That is, do any of these three operating systems have >any justification (other than space savings in the case of Unix and >MacOS) for doing things they way they did? There are operating systems where text files contain no "line separator" at all, but files contain "records", which in the case of "text" files are "lines." These systems typically have lots of file types with attributes such as "variable/fixed length records," "record length," etc. For instance VMS and RTE (on the HP1000). On RTE (the operating system from hell), the actual bytes corresponding to a line containing the characters "abc" are: - a two-byte record length word. The record length is the length in bytes rotated right one bit. (Beause traditionally RTE was word-orientated, and record lengths were counted in words). Thus the 16-bit word 100001 (in octal). - The bytes 'a', 'b', 'c' and a padding ' ' to even length. - the record-length word again. Remember that in Unix it is only the user-level programs that care about line separators. Nothing would need changing in the Unix kernel if one started to use CR-LF pairs for line separation. (Well, maybe one thing: #! interpretation.) -- Tor Lillqvist, working, but not speaking, for the Technical Research Centre of Finland