delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/07/22/21:06:33

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <3797BFD6.F70F730F@wgn.net>
Date: Thu, 22 Jul 1999 18:05:26 -0700
From: "$Bill Luebkert" <dbe AT wgn DOT net>
Organization: DBE Collectibles
X-Mailer: Mozilla 4.61 [en] (Win95; U)
X-Accept-Language: en,en-GB
MIME-Version: 1.0
To: jtr AT mitre DOT org
CC: cygwin AT sourceware DOT cygnus DOT com
Subject: Re: Cat and Head Problems with Binary Files
References: <000301bed4a5$424282a0$0f8e5381 AT Toeplitz DOT mitre DOT org>

Jeffry T Ross wrote:
> 
> Who ever said that cat and head are textutils?
> On the Unix side of the world they're commonly used
> on binary files.  If you have a 10gig file of binary
> data, what the easiest way to get a 10k chunk?
> 
> How about: head -c 10000 bigfile > littlefile
> 
> This works in Unix because Unix thinks all files are
> binary, and that's because all files are binary.  The
> notion of text files is a bogus limitation imposed by
> Microsoft.
> 
> Is there a reason why having cat treat all files as binary
> would cause erroneous performance when cat was used on a
> file you'd consider to be text?

I have a slightly different opinion:

I could just as easily say that cat and text are text utils since 
they operate on text files (even extended 8-bit character text files
which one could call binary).  There is such a thing as 8-bit text.

The point is, on UNIX files are strings of bytes, not binary and not text, 
just a bunch of 8-bit characters strung together in a file.  UNIX doesn't 
care if those bytes are 'Text" or 'Binary' after all, they are/could be both.

A byte is a byte, of course of course, unless of course the byte is 
really two little-endian nybbles. :)

-- 
  ,-/-  __      _  _         $Bill Luebkert   ICQ=14439852
 (_/   /  )    // //       DBE Collectibles   http://www.wgn.net/~dbe/
  / ) /--<  o // //      Mailto:dbe AT wgn DOT net   http://dbecoll.webjump.com/
-/-' /___/_<_</_</_    http://www.freeyellow.com/members/dbecoll/

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019