gm2
[Top][All Lists]
Advanced

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

[Gm2] Re: Error question


From: Gaius Mulley
Subject: [Gm2] Re: Error question
Date: Tue, 23 Nov 2010 08:30:41 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

"Cox, James V" <address@hidden> writes:

> Hi Gaius:
>
> I need to bounce something off of you before I could send a test problem.  In
> one of my utilities I use your FIO.FindPosition, and
> FIO.SetPositionFromBeginning to skip part of a binary file that the particular
> utility does not need to read.
>
> FindPosition ~ line 1455 of FIO
>
> When it calls this function, the file and buffer data are as follow:
> abspos = 19084
> bufstart = 19080
> position = 0
> filled = 0
> As such line 1470 returns a position = 19080
>
> I add a known number of bytes to this value to get 28,440 (pos) and then call
> SetPositionFromBeginning.
>
> SetPositionFromBeginning ~ line 1355
>
> Line 1384 offset is set to pos 28440.
> Line 1385 abspos = 28,440.
>
> The result is that the next read from the file is in the wrong place.  It
> appears to be 4 bytes short of where it should be.
> Looking back at the FindPosition info, I am guessing that if the buffer is
> empty (filled=0) that bufstart and abspos should be the same.  Is this true?
>  It appears to me that abspos was correct and bufstart should have been 19080
> if position=0.

Hi Jim,

yes this is so (unless the buffer is exhausted) I've just checked in a
fix for FIO.mod and ran your test code which now passes.  I introduced a
new field which says whether the buffer is valid which is set false when
a seek occurs or when the buffer is exhausted and contents are read
directly into a user address instead.

Many thanks for the test code it was very mechanism with which to single
step through FIO.

regards,
Gsius

>
> After getting a sanity check on this form you, I?ll look back at my binary IO
> stuff to see if I have a test I can modify.
>
> Thanks, Jim



reply via email to

[Prev in Thread] Current Thread [Next in Thread]