X-Recipient: archive-cygwin AT delorie DOT com X-Spam-Check-By: sourceware.org Date: Thu, 4 Dec 2008 21:12:59 -0800 (PST) From: "Peter A. Castro" To: "Hudec, Jan" cc: cygwin AT cygwin DOT com Subject: Re: How do I prevent zsh from opening pipes and read redirections in text mode? In-Reply-To: <3E4278088AD82C48B4663DDFE762CEF305A2DDED@prga004a.ww300.siemens.net> Message-ID: References: <3E4278088AD82C48B4663DDFE762CEF305A2DDED AT prga004a DOT ww300 DOT siemens DOT net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com On Thu, 4 Dec 2008, Hudec, Jan wrote: > Hello Folks, Greetings, Jan, > I have a program (actually a cygwin program -- git-fast-import) that > reads commands from standard input and absolutely needs the stream to be > binary (byte counts to be read are included in some commands). However, > zsh forces it's input to text mode both when I run: > git-fast-import < file > and > cat file | git-fast-import > despite me having all the mounts set to binary and CYGWIN=binary. How do I explain to zsh, that pipes and read redirections to commands must be binary? I believe it's "binmode", not "binary". Anyway, I can't seem to repro your symptoms. I've created a binary file and can both direct input to, or pipe it via cat, to 'od -xc' and it looks correct to me. Try this: In bash: $ od -xc < /bin/zsh.exe > od.bash In zsh: $ od -xc < /bin/zsh.exe > od.zsh $ ls -al od.* -rw-r--r-- 1 doctor None 23550 Dec 4 21:06 od.bash -rw-rw-r-- 1 doctor None 23550 Dec 4 21:06 od.zsh $ sum od.* 23760 23 od.bash 23760 23 od.zsh Works for me! If 'od' can get a binary stream, then so should your program. Try using cat for your input and see if it fixes it for you: cat file | git-fast-import > Note, that zsh used not to do this and bash is not doing it either. Don't know what to tell you. Nothing has really changed in this area. -- Peter A. Castro or "Cats are just autistic Dogs" -- Dr. Tony Attwood -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/