delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/02/19/13:37:42

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
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 <schneck AT math DOT berkeley DOT edu>
Subject: two text/binary oddities
Date: Thu, 19 Feb 2004 18:37:12 +0000 (UTC)
Lines: 26
Message-ID: <c12voo$tre$1@sea.gmane.org>
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019