Subject: Re: ASCII and BINARY files. Why?
From: [email-masked] ("Alex Stewart")

9 Feb 1997 15:05:34 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7BIT
Comments: Authenticated sender is <[email-masked]>
Original-To: [email-masked], [email-masked]
X-Mailer: Pegasus Mail for Windows (v2.23)
Original-Sender: [email-masked]

> : The issue of modes on pipes would be much less of a problem if the :
> mechanism for converting between DOS/Win text and C native : text were a
> 1:1 mapping (i.e. NL->CRLF, CRLF->NL, CR->CR(always), : (and LF->NL, but
> that's a side-issue)).  This way, if I want to pipe : "gzip -dc file |
> tar xvf -" (as I often do), it wouldn't matter what mode : the pipe was
> created in as  long as it was the same mode on both ends, : because any
> changes introduced in a C->text conversion would be exactly : reversed in
> the text->C conversion on the other end of the pipe.
> 
> Sounds good.
> But how do you define LF vs. NL? I consider them to be the same.

Easy.  LF is when it's in a file, NL is when it's in a C string.  All I
meant by LF->NL was that if there was a LF character (without a
preceeding CR) in a file, it would be "converted" (passed through) to a
NL (LF) when read in text mode. (which actually doesn't have a lot to do
with the issue 1:1 conversion issue as the writing scheme would never
produce a raw LF on its own anyway, so it would just make reading
non-text files in text mode a little cleaner.)

> I often use "tar cvvf - . | gzip > file".

Which, of course, would still experience problems from the ">" 
redirection, tho such problems would be avoided entirely if my other 
suggestion were implemented and tar and gzip were compiled with a "binary" 
flag which caused them both to set their stdin and stdout to binary mode 
when they started up (as part of crt0 processing or some such).

-Alex
-----------------------------------------------------------------------------
      Alex Stewart - [email-masked] - Richelieu @ Diversity University MOO
                          http://www.crl.com/~riche/
            "Difficult answers lead to intelligent questions."
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".