X-Spam-Check-By: sourceware.org To: cygwin AT cygwin DOT com From: Eric Blake 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: 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> <200707251738 DOT l6PHc0j7012306 AT linode DOT hodain DOT net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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: 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 Hugh Secker-Walker 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/