[lxml-dev] Question about newlines
Pete Forman
pete.forman at westerngeco.com
Tue Dec 11 16:06:33 CET 2007
Noah Slater <nslater at bytesexual.org> writes:
> 2) At the very end of the document. POSIX states that all files must
> end in a newline
I disagree. Its definition of Text File does strictly say that.
However the rationale implies that the special cases of empty file and
file ending in an incomplete line might also be added to the strict
definition.
The specifications for ex and sort explicity allow for an incomplete
line, i.e. file not ending with newline. The specs for other
utilities that read text files are silent on the matter. That means
that it is left to the quality of implementation whether such files
are read correctly.
In any case, XML files are probably better thought of as binary from a
POSIX point of view. The line length must be restricted to LINE_MAX
to qualify as text.
--
Pete Forman -./\.- Disclaimer: This post is originated
WesternGeco -./\.- by myself and does not represent
pete.forman at westerngeco.com -./\.- the opinion of Schlumberger or
http://petef.port5.com -./\.- WesternGeco.
More information about the lxml-dev
mailing list