Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com From: Chris Faylor Date: Thu, 27 Apr 2000 23:46:29 -0400 To: "'cygwin AT sourceware DOT cygnus DOT com'" Subject: Re: How is textmode/binmode determined in Cygwin 1.1.0 net release fo r pipes? Message-ID: <20000427234629.B882@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'" References: <20000428020201 DOT 27011 DOT qmail AT web124 DOT yahoomail DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.1.12i In-Reply-To: <20000428020201.27011.qmail@web124.yahoomail.com>; from earnie_boyd@yahoo.com on Thu, Apr 27, 2000 at 07:02:01PM -0700 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 questions. cgf >--- 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 cygwin-unsubscribe AT sourceware DOT cygnus DOT com