Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com To: cygwin AT cygwin DOT com From: Robert R Schneck Subject: two text/binary oddities Date: Thu, 19 Feb 2004 18:37:12 +0000 (UTC) Lines: 26 Message-ID: X-Complaints-To: usenet AT sea DOT gmane DOT org X-Gmane-NNTP-Posting-Host: 80.45.148.56 User-Agent: slrn/0.9.8.0 (CYGWIN_NT-5.1) 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/