This is the mail archive of the 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 release fo r pipes?

On Thu, Apr 27, 2000 at 07:02:01PM -0700, Earnie Boyd wrote:
>The default mount mode for the 1.1.0 Net Relesae is binary mode.  This is a
>change from the text mode of b20.1.  If your text files contain \r\n then you
>need to do one of:
>1) force the mounts back to text
>2) tr -d '\r' < somefile > newsomefile && mv newsomefile somefile
>3) find one of the dos to unix tools and build it to convert the files.

Earnie, this has nothing to do with pipes.  Pipes follow the CYGWIN=binmode
setting.  That's what CYGWIN=binmode is for, actually.  The mount command
doesn't affect pipes.

However, if a pipe is explicitly opened in O_BINARY or O_TEXT mode it
should ignore any CYGWIN=[no]binmode setting.

Let me repeat my standard observation that this is open source.  You can
actually check the source code to get answers to these kind of


>--- David Bolen <> wrote:
>> I just recently updated to the recent net release of 1.1.0, and immediately
>> started running into some problems with my existing use of rsync, which
>> generally disappeared if I reverted to the b20.1 version of cygwin1.dll I
>> had previously been using.  I believe I tracked down the underlying cause,
>> and have a possible workaround, but I was wondering if anyone could validate
>> what I'm seeing and/or suggest a better solution.
>> The root problem appears to be that data being generated by rsync is
>> somewhere along the line getting interpreted as if it was access to a
>> "textmode" filesystem (LF -> CRLF).  I'm using rsync with pipes, so rsync is
>> doing read()/write() to descriptors obtained via the pipe() call.  I don't
>> seem to have the same problem with socket I/O, so it appears to be something
>> specific to the file descriptors returned from pipe().
>> My current filesystem mount points are in textmode (I changed the default
>> established by setup) since I'm stuck dealing with lots of files that still
>> need handling with native NT stuff.  The tools I use either use O_BINARY (as
>> rsync does for actual file access) or I can temporarily mount something
>> binmode, so this hasn't been an issue.
>> I've found that adding CYGWIN=BINMODE to my enviornment seems to resolve the
>> issue - my mount points still explicitly set textmode for file access, and
>> it looks like the environment variable changed the default pipe handling.
>> Can anyone validate that the 1.1.0 release does in fact apply a
>> textmode/binmode decision to pipe file descriptors?  Are there any other
>> alternatives to setting CYGWIN to override this behavior?
>> Thanks for any information.

Want to unsubscribe from this list?
Send a message to

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