delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/04/10/09:56:24

From: iverson AT cisco DOT com (Tim Iverson)
Subject: Re: cat and binary files
10 Apr 1997 09:56:24 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199704100238.TAA21049.cygnus.gnu-win32@rottweiler.cisco.com>
Mime-Version: 1.0
Original-To: huott AT pinebush DOT com (Ed Huott)
Original-Cc: marc AT watson DOT ibm DOT com, gnu-win32 AT cygnus DOT com
In-Reply-To: <199704092122.RAA06770@sol.pinebush.com> from "Ed Huott" at Apr 9, 97 05:22:26 pm
X-Mailer: ELM [version 2.4 PL25]
Original-Sender: owner-gnu-win32 AT cygnus DOT com

If cat is stopping at Ctl-Z on anything but console input, it is a bug.
There has been no actual "end-of-file" marker in DOS since version 2.0.
The Ctl-Z is only EOF for the *console*, just like Ctl-D is EOF for
/dev/tty under Unix.  And, like /dev/tty, it's only EOF when the console is
in cooked mode.  If you put the console into raw mode, Ctl-Z does nothing.

Some DOS programs have yet to alter their behavior and still place Ctl-Z at
the end of disk files.  This is also a bug, though if you want to support
DOS 1.0, you could call it a feature.

All this aside, IMHO, cat is inherently a binary program -- it shouldn't
care whether newline is CR, LF, or CR+LF unless one of the line-based
options is used (bns).

BTW, I wouldn't recommend using binary mode.  I tried that briefly and
found that rebuilding will fail rather miserably.


- Tim Iverson
  iverson AT cisco DOT com


+----------------
| To: marc AT watson DOT ibm DOT com
| cc: Win32 Mailing List <gnu-win32 AT cygnus DOT com>
| Subject: Re: cat and binary files 
| Date: Wed, 09 Apr 1997 17:22:26 -0400
| From: Ed Huott <huott AT pinebush DOT com>
| 
| In message <9704091349 DOT AA39368 AT marc DOT watson DOT ibm DOT com>, Marc Auslander writes:
| >cat seems to stop before the end of input - I assume at an end of file
| >character.  cat --help doesn't offer a binary flag.  How can I cat
| 
| Use the 'mount' command with the '-b' option to make sure that the
....
| can be set to 1 to turn on the behavior where all files are treated as
| binary (recommended).
-
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