delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/04/18/23:53:18

From: rkim1 AT san DOT rr DOT com (Richard Y. Kim)
Subject: how to force pipes into binary mode?
18 Apr 1998 23:53:18 -0700 :
Message-ID: <199804190253.TAA22986.cygnus.gnu-win32@prefetch.san.rr.com>
References: <3537AEEE DOT 33F3E0BC AT uni-paderborn DOT de>
Reply-To: rkim AT ElectronicDNA DOT com
Mime-Version: 1.0
To: Frank Baumgart <godot AT uni-paderborn DOT de>
Cc: gnu-win32 AT cygnus DOT com

>>>>> "Frank" == Frank Baumgart <godot AT uni-paderborn DOT de> writes:

    Frank> So, how do I force my pipes which have been created with
    Frank> pipe() to work in binary mode?

Get 
     ftp://ftp.cygnus.com/pub/gnu-win32/gnu-win32-b19/usertools-src.tar.gz

This includes the source for _bash_.
In the bash subdirectory, find the file execute_cmd.c,
In this file, search for the definition of do_piping().
You will see 3 instances of 

  #ifdef __CYGWIN32__
        setmode (0, O_TEXT);
  #endif

in this function. I believe taking out all three sets of code reverts
_bash_ back to the "correct" setting.  Please correct me if I'm wrong.

I want to thank Larry Hall <lhall AT rfk DOT com> for pointing out where to
find above code when I had the same question as Frank.

    Frank> Or better: are there any patches or even cygwin32.dll
    Frank> available working in binary mode generally? (pipes doing
    Frank> text-mode translation is so stupid!)

I could not agree more based on my personal experience. I tried out
gnu-win32 about two years ago. I dropped it right away, because of
problems which I now think were due to text mode pipes. I did not have
the time nor the incentive to figure out what was going on then. I
gave gnu-win32 another shot about a year ago. I dropped it again after
couple of days due to similar problems. This is my third time
around. This time, I spent more time. With the help of people on
gnu-win32 mailing list, I now understand what I need to do to use
gnu-win32.

I hope that Cygnus people take out the code they put in to force text
mode pipe in _bash_ in the next release of gnu-win32.

Richard Y. Kim

-
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