This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: ASCII and BINARY files. Why?


> : 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 - riche@crl.com - 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
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]