This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How is textmode/binmode determined in Cygwin 1.1.0 net releas e for pipes?


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@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]