delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/04/28/00:36:07

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
From: Chris Faylor <cgf AT cygnus DOT com>
Date: Fri, 28 Apr 2000 01:36:31 -0400
To: "'cygwin AT sourceware DOT cygnus DOT com'" <cygwin AT sourceware DOT cygnus DOT com>
Subject: Re: How is textmode/binmode determined in Cygwin 1.1.0 net releas e for pipes?
Message-ID: <20000428013631.B1852@cygnus.com>
Reply-To: cygwin AT sourceware DOT cygnus DOT com
Mail-Followup-To: cgf AT cygnus DOT com,
"'cygwin AT sourceware DOT cygnus DOT com'" <cygwin AT sourceware DOT cygnus DOT com>
References: <1DB8BA4BAC88D3118B2300508B5A552C0C8CDE AT mail DOT fitlinxx DOT com>
Mime-Version: 1.0
User-Agent: Mutt/1.1.12i
In-Reply-To: <1DB8BA4BAC88D3118B2300508B5A552C0C8CDE@mail.fitlinxx.com>; from db3l@fitlinxx.com on Fri, Apr 28, 2000 at 01:24:36AM -0400

On Fri, Apr 28, 2000 at 01:24:36AM -0400, David Bolen wrote:
>So, without asking for too much specific help (treading cautiously here :-))
>- is it possible that line 157 in hinfo.cc should be changed from:
>
>  int bin = __fmode;
>
>to
>
>  int bin = (__fmode ? __fmode : O_BINARY)
>
>in order to make the default for stdin/stdout binary even if CYGWIN isn't
>set?  That seems to mirror the way that pipe.cc checks things when it's
>making the pipes.

I appreciate the suggestion but I don't think that we can do that.  The
fact that stdout didn't default to text mode and didn't track the
CYGWIN=binmode setting was actually a bug in b20.1.  This is all coming
back to me now.  We had complaints about this so we changed it in the
snapshots and later for the Cygwin CD.

Pipes are a separate issue since they are usually simple conduits and
shouldn't be translating data.

>I haven't yet run a full build of the DLL locally, so I'll have to schedule
>some time tomorrow to do that to test the change locally?  But adding a
>setmode(O_BINARY) on both stdin and stdout in the rsync code did resolve the
>problem without having to add the CYGWIN environment variable.

I think that's probably the best solution, actually.  There is also a
currently undocumented way to set a program's "CYGWIN settings" in the
registry by setting something a value for:

HKLU/Software/Cygnus Solutions/Cygwin/Program Options/c:\usr\local\bin\rsync.exe

to:

binmode

I really hate this text mode/binary mode stuff.  I wish it had never
been invented.  I think we'd probably have fewer problems if we hadn't
tried to be so clever.  Now, we're stuck with it, though.

cgf

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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