[Gambas-user] READ file problem - bug
gambas at ...1...
Fri May 13 11:34:02 CEST 2005
On Thursday 12 May 2005 21:53, nando wrote:
> One of my programs has uses a data file
> where the first two bytes in the file
> were written as a SHORT (2 bytes) with
> the value 999 (base 10)
> When my program starts,
> part of the initialization is to read this SHORT.
> I have a problem because the SHORT value
> read in is -6397 which happens to be exactly
> the BIG ENDIAN representation of 999
> The 999 was initially written LITTLE ENDIAN as a SHORT
> and when I use KHexEdit, viewing the beginning of
> the data file, I see 999 (decimal) LITTLE ENDIAN
> and when I click to see BIG ENDIAN, it is -6397.
> I specicially open the file as READ LITTLE.
> This is a repeatable problem I encounter.
> I have verified this a few times before writing this.
> Perhaps I doing something wrong.
Can you try to open the file in buffered mode ? I think the problem comes from
the bug I talked about in your previous private mail.
mailto:gambas at ...1...
More information about the User