In a previous article, GaryScott <garylscott@[EMAIL PROTECTED]
> wrote:
>On Jul 23, 8:44=A0am, badger <mdeka...@[EMAIL PROTECTED]
> wrote:
>> On 23 Jul, 08:08, m...@[EMAIL PROTECTED]
wrote:
>>
<snip>
>> > >As I said I think that the way I have approached it thus far is ok -
>> > >open file read header, close file, reopen file and try and read
>> > >binary. Only I have no idea how to read the binary part - I can't
seem
>> > >to skip over the binary bit!!
>>
>> > >Thanks.
>>
>> > =A0 Depends what binary means - sometimes that will have record
sizes.
>> > Anyway - assuming it is "straight binary" - I.e. you can
>> > read in any amount anytime and not lose anything,
>> > I would suggest reading the header unformatted- as a
>> > array of bytes - which could be equivalenced to a string,
>> > on wbich you could do an internal read.
>> > Chris
>>
>> Thanks - but...
>> As I said and showed in my code - I can read the header bit fine. I
>> then close the file, and reopen it to read the binary (bytes in this
>> case) but I have no idea how to step across the header again when I
>> reopen it and try to read the file as binary?- Hide quoted text -
>>
>> - Show quoted text -
>
>One possible hint: If the header size is fixed (or you otherwise know
>its size), just read it into a dummy/unused variable and discard it
>(define a second header (or reuse the old variable if you're done with
>it or have saved it off) and include it on the "binary" read (assuming
>it represents the proper size).
But be aware that if the original header data were
somehow written as formatted, there may be a crlf to skip
as well.
Your system may have a hex dump utility - in which
case you could look and see - the utility will often
show simultaneous hex and ascii decoding.
Chris


|