delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/07/25/14:54:39

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: Eric Blake <ebb9 AT byu DOT net>
Subject: Re: 1.5.24: incorrect default behavior of dd in popen context on text-mounted filesystem
Date: Wed, 25 Jul 2007 18:54:02 +0000 (UTC)
Lines: 29
Message-ID: <loom.20070725T203127-915@post.gmane.org>
References: <200707241548 DOT l6OFmXAE008571 AT linode DOT hodain DOT net> <46A64F0F DOT 20706 AT byu DOT net> <200707251419 DOT l6PEJnYK011631 AT linode DOT hodain DOT net> <loom DOT 20070725T163755-841 AT post DOT gmane DOT org> <200707251738 DOT l6PHc0j7012306 AT linode DOT hodain DOT net>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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

Hugh Secker-Walker <hsw <at> hodain.net> writes:

> My interpretation is thus that when a shell is redirecting
> to a file it will open the in binary mode (because I have
> CYGWIN=binmode).

Explicitly setting CYGWIN=binmode is a no-op.  According to 
http://cygwin.com/cygwin-ug-net/using-cygwinenv.html, CYGWIN already defaults 
to binmode set.  binmode/nobinmode is binary, not ternary.  In short, disk 
files are controlled by mount, all other file descriptors are controlled by 
no/binmode; and except for disk files, there are very few uses of text mode, so 
in general, mount is good enough to trigger any desired text mode processing 
without resorting to changing CYGWIN.

> It seems to me that if the shell(s) were to honor Warning 4 when
> redirecting, then maintainers of individual programs would not have to
> fuss over whether to change the modes of the stdin/stdout fds that
> they've been given.  This puts (or leaves) control in the hands of the
> caller of the executable.

I also maintain bash, and I would rather not have bash inspect the contents of 
the CYGWIN environment variable at every process invocation in order to bypass 
mount settings.  I intend to leave the parsing of the CYGWIN variable to 
cygwin1.dll at process startup, and to let bash honor mount settings as it 
currently does.

-- 
Eric Blake



--
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