VSI Position Error
|Reported by:||warmerdam||Owned by:||warmerdam|
On a file of 200 bytes, this sequence:
VSIFReadL(buf, 500, 1, fp ); VSIFSeekL(fp,0,SEEK_SET); VSIFReadL(buf2, 1, 500, fp );
does not read anything the second time. The reason is that the file offset in cpl_Vsil_unix_stdio64 does not get updated when the first read fails to read a complete object even though the underlying file pointer has been updated to be at "200". The seek is short circuited and the second read starts at eof.
Presumably the VSI functions need to be more careful to keep the VSI*L offset up to date with that of the underlying implementation.