delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/06/13/19:50:04

From: jyh AT cs DOT cornell DOT edu (Jason Hickey)
Subject: Re: Problem with stdout BINARY
13 Jun 1997 19:50:04 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199706131450.KAA07174.cygnus.gnu-win32@cloyd.cs.cornell.edu>
References: <2 DOT 2 DOT 32 DOT 19970613131058 DOT 00964444 AT ma DOT ultranet DOT com>
Original-To: Larry Hall <lhall AT rfk DOT com>
Original-cc: gnu-win32 AT cygnus DOT com
In-Reply-To: <2.2.32.19970613131058.00964444@ma.ultranet.com>
X-Face: $tsnqT``tn7U3/uW*Z+d=O5bh1'T^86$3I(2EL0^#]<th-'d?|vJ")-$aJX?#bR|@%BNUb/
`1r-eC{-5.[YSA&,: {b#V4y-,SS5&!-}NuZ$MR[D6Fl AT Ub/>WvS6~GV41O5CQlf2}8#N,m>DFK}Ya`
Wux,YSwY~w|CyQF?y1xruG]qR%BxY=Wcs)?|/
Original-Sender: owner-gnu-win32 AT cygnus DOT com

In the patch that I posted below for bash, I neglected to set pipes in
binary mode.  The fix is a small change to execute_cmd.c, where there
is an explicit call to setmode(fd, O_TEXT) for pipes.  I'm not sure
what the intension was in placing pipes in TEXT mode, but I would
rather have binary mode pipes.  This allows commands like
"zcat bash.tgz | tar xvf -".  I put the update in the same place,

    http://www.cs.cornell.edu/home/jyh/cygwin32/

Jason

Larry Hall writes:
 > Thanks!  This is excellent.  I've been planning to do something about this
 > oversight for quite a while but haven't gotten around to it.  I really 
 > haven't looked at what you've done yet but perhaps you can tell me, does
 > your change also fix the similar problem with pipes?
 > 
 > Larry
 > 
 > At 11:04 AM 6/12/97 -0400, you wrote:
 > > > At 11:29 AM 6/11/97 +0100, you wrote:
 > > > >Hi everybody,
 > > > >
 > > > >Trying to write gif file in stdout with 'putchar'. b18 seems to add a CRNL
 > > > >every CR he
 > > > >founds in the file.
 > > > 
 > >
 > >I've run into the same problem--for instance, if "x" is a binary file,
 > >the commands "dd if=x of=y" and "dd if=x > y" produce different
 > >results ("cat x > y" doesn't work because cat opens its input in TEXT
 > >mode).  This is an incredible headache, but the fix is pretty easy.
 > >
 > >You need to recompile bash, which always opens redirects in TEXT mode.
 > >You can download my patched copy of bash at
 > >
 > >    http://www.cs.cornell.edu/home/jyh/cygwin32/

-- 
Jason Hickey			Email: jyh AT cs DOT cornell DOT edu
Department of Computer Science	Tel: (607) 255-1372
Cornell University


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019