Unix text files

Doug Gwyn <gwyn> gwyn at brl-tgr.ARPA
Sun Oct 27 17:51:35 AEST 1985


> "Text consists of an ordered sequence of characters, with lines delimited
> by newline characters.  Text is normally terminated by a newline.  This
> newline should be considered to be followed by a (nonexistant) null line.
> The null line should not be considered to be part of the text.
> 	"If the last character of the text is not a newline, then consider
> the text to be terminated by a newline - null line pair; however, this
> newline - null line pair should not be considered to have been part of
> the file.
> 
> I *think* that's right...
> 							Kay.

Perhaps that is the best interpretation, but it sure is hard
to put all that into a formal grammar, whereas the original
concept was very simple:

file		::=	binary_file	|	text_file

binary_file	::=	{ byte }*

byte		::=	<primitive unit of data,
				at least 8 bits>

text_file	::=	{ text_line }*

text_line	::=	{ text_char }* newline

text_char	::=	<7-bit ASCII character
				excluding NUL and newline>

newline		::=	<ASCII LF character>



More information about the Comp.unix mailing list