Hi Pirotic
this is not the way to do it fast, any kind of file parsing like this will be slow esp for large amounts of data. The usual way to this is to read/write the structures directly:
bytes=sizeof(mystruct);
GpFileRead(h_file, mystruct, offset, (ulong*)bytes );
or
bytes=sizeof(mystruct)...