delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/11/17/03:15:01

From: Pierre DOT Humblet AT eurecom DOT fr (Pierre A. Humblet)
Subject: Handling of CYGWIN=binmode by bash
17 Nov 1998 03:15:01 -0800 :
Message-ID: <3.0.5.32.19981116171548.00896100.cygnus.gnu-win32@pop.ne.mediaone.net>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

I have noticed an inconsistency in the way ash & bash handle CYGWIN=binmode
in b20 on Win95.
Drive a: is not mounted. It contains a file "empty" and a 
file "crnl" containing CR NL
The program "tell_mode" reports on stderr the modes of stdin and stdout.

bash: mount
Device           Directory           Type        Flags
\\.\tape1:       /dev/st1            native      text!=binary
\\.\tape0:       /dev/st0            native      text!=binary
\\.\b:           /dev/fd1            native      text!=binary
\\.\a:           /dev/fd0            native      text!=binary
c:               /                   native      text=binary

The unexpected results occur with bash on line 5 below (compare with 2).
The redirected input/output are opened as TEXT (I expected BINARY).
Note that as expected the program "cat" opens BINARY under ash and bash
(lines 3 & 6, compared with 8). 

1 ash: echo $CYGWIN
tty binmode
2 ash: tell_mode < a:/empty > a:/out
fd = 0 BINARY
fd = 1 BINARY
3 ash: cat a:/crnl | od -c
0000000  \r  \n

4 bash: echo $CYGWIN
tty binmode
5 bash: tell_mode < a:/empty > a:/out
fd = 0 TEXT
fd = 1 TEXT
6 bash: cat a:/crnl | od -c
0000000  \r  \n

7 bash: CYGWIN=tty
8 bash: cat a:/crnl | od -c
0000000  \n

I am happy to report that all other tests I have performed yield the
expected results.

Pierre

-
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