<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#0000ff">Argh -- I standard corrected. We worked hard at the beginning to keep that crap out -- sigh.</font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#0000ff"><br></font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#0000ff">But at least is does says:</font> <font color="#38761d"><span style="font-family:Arial,Helvetica,sans-serif">POSIX.1-2024 <i><u>does not </u></i></span><span style="font-family:Arial,Helvetica,sans-serif"><i><u>distinguish between text files and binary files</u></i> (see the ISO C standard)</span></font></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><font color="#38761d"><span style="font-family:Arial,Helvetica,sans-serif"><br></span></font></div><div class="gmail_default" style=""><font color="#0000ff">So my point is the same: don't blame POSIX- this is an ANSI C issue, and utilities really should not care.</font></div></div><div hspace="streak-pt-mark" style="max-height:1px"><img alt="" style="width:0px;max-height:0px;overflow:hidden" src="https://mailfoogae.appspot.com/t?sender=aY2xlbWNAY2NjLmNvbQ%3D%3D&type=zerocontent&guid=0dad76f7-1213-455a-9664-61f0407c10cf"><font color="#ffffff" size="1">ᐧ</font></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Mar 27, 2025 at 2:53 PM Chet Ramey <<a href="mailto:chet.ramey@case.edu">chet.ramey@case.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 3/27/25 2:45 PM, Clem Cole wrote:<br>
> <br>
> Branden Robin wrote:<br>
> <br>
> <br>
> >> info groff gives semantics for including nonempty files that don't end<br>
> >> with newline. Such files violate the Posix definition of text file.<br>
> <br>
> <br>
> Not so fast. POSIX does not define a text file (that's an ANSI C-ism - <br>
> thank you DOS -- more in minute).<br>
<br>
It does.<br>
<br>
"3.387 Text File<br>
<br>
A file that contains characters organized into zero or more lines. The<br>
lines do not contain NUL characters and none can exceed {LINE_MAX} bytes in<br>
length, including the <newline> character. Although POSIX.1-2024 does not<br>
distinguish between text files and binary files (see the ISO C standard),<br>
many utilities only produce predictable or meaningful output when operating <br>
on text files. The standard utilities that have such restrictions always <br>
specify "text files" in their STDIN or INPUT FILES sections."<br>
<br>
<a href="https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html#tag_03_387" rel="noreferrer" target="_blank">https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html#tag_03_387</a><br>
<br>
A line is defined as:<br>
<br>
"3.185 Line<br>
<br>
A sequence of zero or more non-<newline> characters plus a terminating<br>
<newline> character."<br>
<br>
<a href="https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html#tag_03_185" rel="noreferrer" target="_blank">https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html#tag_03_185</a><br>
<br>
-- <br>
``The lyf so short, the craft so long to lerne.'' - Chaucer<br>
``Ars longa, vita brevis'' - Hippocrates<br>
Chet Ramey, UTech, CWRU <a href="mailto:chet@case.edu" target="_blank">chet@case.edu</a> <a href="http://tiswww.cwru.edu/~chet/" rel="noreferrer" target="_blank">http://tiswww.cwru.edu/~chet/</a><br>
</blockquote></div>