delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/07/22/20:52:46

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
Reply-To: <jtr AT mitre DOT org>
From: "Jeffry T Ross" <jtr AT mitre DOT org>
To: <cygwin AT sourceware DOT cygnus DOT com>
Subject: RE: Cat and Head Problems with Binary Files
Date: Thu, 22 Jul 1999 20:49:45 -0400
Message-ID: <000301bed4a5$424282a0$0f8e5381@Toeplitz.mitre.org>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook 8.5, Build 4.71.2173.0
Importance: Normal
In-Reply-To: <19990723003124.545.rocketmail@web106.yahoomail.com>
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3

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?


Thanks,
jtr AT mitre DOT org
 

-----Original Message-----
From: Earnie Boyd [mailto:earnie_boyd AT yahoo DOT com]
Sent: Thursday, July 22, 1999 8:31 PM
To: jtr AT mitre DOT org; cygwin AT sourceware DOT cygnus DOT com
Subject: Re: Cat and Head Problems with Binary Files


--- Jeffry T Ross <jtr AT mitre DOT org> wrote:
> I've seen a lot of discussion about cat's handling of binary files.
> What I didn't see and would like to know is if the next version of
> cygwin will allow me to correctly pipe or redirect the output from
> cat and head if the source is a binary file?  Also, why were these
> programs implemented this way to begin with?
> 

They are textutils for text files.  If you want something different, that is
the reason it's OpenSource.


> 
> I'm trying to pipe a binary file to a program I wrote and either
> the pipe/redirect is breaking or cat/head is dying at arbitrary
> points in the binary files.  I suspect that my binary files contains
> what looks like an EOF.  This is similar to other threads I've seen
> on this list.
> 

Definitly.  In this case, eiter modify the sources and recompile or use binary
mounts which will default to binary file processing.  WARNING: You'll have to
change all \r\n line endings in scripts to \n.


===
Earnie Boyd <mailto:earnie_boyd AT yahoo DOT com>

Newbies, please visit
<http://www.freeyellow.com/members5/gw32/index.html>

(If you respond to the list, then please don't cc me)
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
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