[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Binary Files with ASCII headers



On Fri, 4 Jun 1999, bobbys wrote:

> I have a series of binary files that each have 256 byte ASCII headers.
> 
> What is the safest way for me to strip off (and save seperately) each of these
> ASCII headers while making sure that the resulting files remain "true" binaries?
> 
> I was thinking along the lines of a regex, but wasn't sure how it would play
> with a binary file.  
> 
You can do regexes with high ASCII, but given your problem, why bother?

For each data file, open it for read, and open two others for write. Read
in the first 256 bytes, and write it to output file #1. You're now
positioned at the start of the binary (8-bit ASCII), which you then write
to output file #2.

Arved



===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org