Opened 12 years ago
Closed 12 years ago
#4583 closed defect (fixed)
VSI Position Error
Reported by: | warmerdam | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 1.9.1 |
Component: | default | Version: | unspecified |
Severity: | normal | Keywords: | VSIL |
Cc: |
Description
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.
Change History (2)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Milestone: | → 1.9.1 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Note: in trunk you can trigger this issue by changing:
to:
in ogrvrtdatasource.cpp and then trying to read autotest/ogr/data/poly_vrt.vrt with ogrinfo.