Subject: Mount text=binary AND Mount text!=binary broken
From: [email-masked] ("Bruce J. Moore")

17 Jul 1997 07:57:16 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Reply-To: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Original-To: [email-masked]
X-Mailer: <IMAIL v1.07.24>
Original-Sender: [email-masked]

Greetings,

	I *know* that this has been hashed to death, but it still isn't
"correct".

	Even if / is mounted binary, then stdout still isn't.  This means
that lines like "cat foo|tr -d \r >bar" won't work no matter what you do.
Further, "cat foo|tr -d \r |od -c|head" will lie and tell
you that it did!

	As shown below, if binary is ON, there is a bug at the block boundary,
and an extra CR is added at each block.

	If binary is OFF, then od *always lies* about its input.  It silently
maps CRLF to LF before dumping.  This behavior cannot be correct.

	As I see it there are 3 problems:

	1. There seems to be no way to make stdout writes binary.
	2. The extra CR added to stdout writes at block boundary if binary is ON.
	3. od.exe is broken unless binary is ON for file
arguments and *always*
	broken for pipes.

	The batch file (and its corresponding log) should illustrate these points.

Bruce

breakit.bat
-----------

pause Change
mount of / to binary in regedit
mount
sed n Defines.h >foo
sed n foo >foo1
cmp foo foo1
ls -l Defines.h foo foo1
od -c foo|head

pause Change mount of / to ascii in regedit
mount
sed n Defines.h >foo
sed n foo >foo1
ls -l Defines.h foo foo1
od -c foo|head

breakit.log
-----------

pause Change mount of / to binary in regedit
Change mount of / to binary in regedit
mount
Device           Directory           Type        Flags
\\.\tape1:       /dev/st1            native      no-mixed,text!=binary
\\.\tape0:       /dev/st0            native      no-mixed,text!=binary
\\.\b:           /dev/fd1            native      no-mixed,text!=binary
\\.\a:           /dev/fd0            native      no-mixed,text!=binary
c:               /                   native      no-mixed,text=binary
sed n Defines.h >foo
sed n foo >foo1
cmp foo foo1
foo foo1 differ: char 16385, line 566
ls -l Defines.h foo foo1
-rw-r--r--   1 bmoore   Users      141200 May 08 10:25 Defines.h
-rw-r--r--   1 bmoore   Users      146269 Jul 17 10:17 foo
-rw-r--r--   1 bmoore   Users      146275 Jul 17 10:17 foo1
od -c foo
0000000   /   *      \r  \n               D   e   f   i   n   e   s   .
0000020   h  \r  \n  \r  \n               W   i   n   d   o   w   s   3
0000040   2       A   P   I       d   e   f   i   n   i   t   i   o   n
0000060   s  \r  \n  \r  \n               C   o   p   y   r   i   g   h
0000100   t       (   C   )       1   9   9   6       F   r   e   e    
0000120   S   o   f   t   w   a   r   e       F   o   u   n   d   a   t
0000140   i   o   n   ,       I   n   c   .  \r  \n  \r  \n            
0000160   A   u   t   h   o   r   :       S   c   o   t   t       C   h
0000200   r   i   s   t   l   e   y       <   s   c   o   t   t   c   @
0000220   n   e   t   -   c   o   m   m   u   n   i   t   y   .   c   o
pause Change mount of / to ascii in regedit
Change mount of / to ascii in regedit
mount
Device           Directory           Type        Flags
\\.\tape1:       /dev/st1            native      no-mixed,text!=binary
\\.\tape0:       /dev/st0            native      no-mixed,text!=binary
\\.\b:           /dev/fd1            native      no-mixed,text!=binary
\\.\a:           /dev/fd0            native      no-mixed,text!=binary
c:               /                   native      no-mixed,text!=binary
sed n Defines.h >foo
sed n foo >foo1
ls -l Defines.h foo foo1
-rw-r--r--   1 bmoore   Users      141200 May 08 10:25 Defines.h
-rw-r--r--   1 bmoore   Users      146269 Jul 17 10:17 foo
-rw-r--r--   1 bmoore   Users      146269 Jul 17 10:17 foo1
od -c foo
0000000   /   *      \n               D   e   f   i   n   e   s   .   h
0000020  \n  \n               W   i   n   d   o   w   s   3   2       A
0000040   P   I       d   e   f   i   n   i   t   i   o   n   s  \n  \n
0000060               C   o   p   y   r   i   g   h   t       (   C   )
0000100       1   9   9   6       F   r   e   e       S   o   f   t   w
0000120   a   r   e       F   o   u   n   d   a   t   i   o   n   ,    
0000140   I   n   c   .  \n  \n               A   u   t   h   o   r   :
0000160       S   c   o   t   t       C   h   r   i   s   t   l   e   y
0000200       <   s   c   o   t   t   c   @   n   e   t   -   c   o   m
0000220   m   u   n   i   t   y   .   c   o   m   >  \n  \n            

------------------
[email-masked]
Allen-Bradley Company

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".