delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/09/14/09:00:37

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <19990914130038.2411.rocketmail@web119.yahoomail.com>
Date: Tue, 14 Sep 1999 06:00:38 -0700 (PDT)
From: Earnie Boyd <earnie_boyd AT yahoo DOT com>
Reply-To: earnie_boyd AT yahoo DOT com
Subject: Re: awk question : 0x1a - file end problem
To: "Lasslop, Andre" <Andre DOT Lasslop AT vs DOT dasa DOT de>, cygwin AT sourceware DOT cygnus DOT com
MIME-Version: 1.0

--- "Lasslop, Andre" <Andre DOT Lasslop AT vs DOT dasa DOT de> wrote:
> Hello,
> 
> I'm trying to scan binary files (log files of serial i/o, contains lists of
> binary messages with header,tail, and timestamp) with the awk - program. The
> awk-script does what I want. The only problem I detect is, if a 0x1a - Byte
> occurs within the input file this is interpreted as a premature end of file
> ! I know, the awk program is for text-file scanning. Therefore : is there
> any other possibility to scan such binary files for byte-patterns without
> programming such tool by myself ?

The most sure way is to get the source for awk and add a switch to indicate
that you want to process in binary mode and then ensure that the fd's are set
to O_BINARY when the switch is used.

For the time being you can use binary mounts to achieve binary mode defaults. 
Caution, scripts and source files with \r\n will need to be modified to \n
only.  
===
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!?
Bid and sell for free at http://auctions.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