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]

How is textmode/binmode determined in Cygwin 1.1.0 net release for pipes?

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.

-- David

 \               David Bolen            \   E-mail:  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \

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]