This is the mail archive of the cygwin 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]
Other format: [Raw text]

two text/binary oddities


Short form:
1) "cat > foo" creates foo with DOS line endings... no matter what.
2) A control-Z in a file doesn't act as end-of-file in text mode, 
despite what the Cygwin User's Guide says.

Long form:
1) Apparently, cat sometimes explicitly sets stdout to O_TEXT.  This
occurs twice in the source, once with the comment
              /* If stdin is a terminal device, and it is the ONLY
                 input file (i.e. we didn't write anything to the
                 output yet), switch the output back to TEXT mode.
                 This is so "cat > xyzzy" creates a DOS-style text
                 file, like people expect.  */
It's certainly not what a Cygwin user with binary mounts and
CYGWIN="tty binmode" is likely to expect.  I suggest that both 
occurences of setting the mode of stdout be removed from the Cygwin
port of cat.

2) Well, the Cygwin User's Guide says
  b. On reading in text mode, a CR followed by an NL is deleted and a ^Z
     character signals the end of file.
Happily for me, only the first seems to be happening.  Are the docs out 
of date, or did I test insufficiently, or is the situation more 
complicated?

Robert


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


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