delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1996/10/29/05:46:12

From: jjf AT dsbc DOT icl DOT co DOT uk (J.J.Farrell)
Subject: Re: using cat on binary files (CTRL-Z trauma)
29 Oct 1996 05:46:12 -0800 :
Sender: daemon AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199610291143.12615.0.cygnus.gnu-win32@dsbc.icl.co.uk>
Original-To: hgeleff AT logos DOT cy DOT net (Henrik Geleff)
Original-Cc: gnu-win32 AT cygnus DOT com
In-Reply-To: <199610281747.TAA11664@zenon.logos.cy.net> from "Henrik Geleff" at Oct 28, 96 05:49:44 pm
X-Mailer: ELM [version 2.4 PL23]
Original-Sender: owner-gnu-win32 AT cygnus DOT com

> From: "Henrik Geleff" <hgeleff AT logos DOT cy DOT net>
> Date: Mon, 28 Oct 1996 17:49:44 +0200
> 
> I do think it is correct for cat to pick CTRL-Z as an end of file on the
> DOS/Windows/NT platforms, the CTRL-Z has been inherited by these platforms 
> from CP/M, which was not able to determine how much of the last sector
> actually was file contents. Basicly:
> 
> - cat was intended to show text files -- cat'ing binary files to an ASCII
> terminal can bring the terminal into a state which you can not escape from
> in an orderly manner (i.e. logging out).

Could you present some evidence that cat was intended to show text
files, please. I had always understood that its purpose was to
catenate named files together and write the result to its stdout;
it was intended to send data down a pipeline of programs which
would process it, or to send them down a physical line to a printer.
I believe that the fact that it can display files to a terminal is
a coincidental result of the UNIX design philosophy.

I use command-line mode UNIX for many hours every day. I rarely (if
ever) use cat to display files to the terminal, but I frequently
use it to send both binary and text files down pipes.

I don't know GNU cat, and I haven't got a copy of POSIX to hand;
but some modern cats have command line options to display
unprintable characters in a printable manner. It would be within
this spirit if GNU cat allowed you to specify on the command line
whether or not the input files should be read as binary.

Regards,
		jjf
-
For help on using this list, 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