delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/05/30/19:12:11

From: franl AT world DOT std DOT com (Francis Litterio)
Subject: [b18] Are pipes always in text mode?
30 May 1997 19:12:11 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <3394ed84.91485068.cygnus.gnu-win32@world.std.com>
Mime-Version: 1.0
Original-To: gnu-win32 AT cygnus DOT com
X-Mailer: Forte Agent 1.01/32.397
Original-Sender: owner-gnu-win32 AT cygnus DOT com

I checked the FAQ and the list archives, but found nothing about
this...

In the b18 release, I'm using binary mounts, but I'm seeing
text-mode-style CRNL->NL conversions on data sent down a pipe:

	$ od -c foo
	0000000   h   e   l   l   o  \r  \n
	0000007
	$ od -c < foo
	0000000   h   e   l   l   o  \r  \n
	0000007
	$ cat foo > bar; od -c bar
	0000000   h   e   l   l   o  \r  \n
	0000007
	$ cat foo | od -c
	0000000   h   e   l   l   o  \n
	0000006

First, the inconsistent text/binary mode for redirection versus pipes
can probably be considered a bug.  File descriptor 1 is sometimes
text-mode and sometimes binary mode depending on how the application
was spawned by the shell!

Second, is there any way to make all data traversing pipes be treated
as binary (without recompiling anything)?  If not, perhaps there can
be a mount option that controls the text/binary distinction for
redirected and piped file descriptors (for those of us who wish to
live in an all-binary-all-the-time GNU-Win32 world).
--
Francis Litterio                     PGP Key Fingerprint:
franl AT world DOT std DOT com                  02 37 DF 6C 66 43 CD 2C
http://world.std.com/~franl/         10 C8 B5 8B 57 34 F3 21

"They that can give up essential liberty to obtain a little temporary 
 safety deserve neither liberty nor safety." -- Ben Franklin, ~1784
-
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