Opened 16 years ago

Closed 16 years ago

#2192 closed enhancement (fixed)

[PATCH] Detect I/O read errors in RawRasterBand

Reported by: Even Rouault Owned by: warmerdam
Priority: normal Milestone: 1.6.0
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: rawrasterband
Cc:

Description

I'm attaching a patch that reports I/O errors detected in RawRasterBand::AccessLine, when the dataset is accessed in read only mode. Currently no error is reported. This tries to address the following comment in the current code :

// for now I just set to zero under the assumption we might
// be trying to read from a file past the data that has
// actually been written out.  Eventually we should differentiate
// between newly created datasets, and existing datasets. Existing
// datasets should generate an error in this case.

The patch also includes missing "poDS->eAccess = poOpenInfo->eAccess" in a few drivers using RawRasterBand.

However, with this patch, the autotest suite fails in a few places. By looking at the files, I can see that the data files seem to be truncated to a few bytes.

Extract from errors found when running autotest :

Running tests from gdrivers/ers.py
  TEST: ers_1 ... ERROR 3: Failed to read scanline 5.
Running tests from gdrivers/fast.py
  TEST: fast_2 ... ERROR 3: Failed to read scanline 100.
  TEST: fast_5 ... ERROR 3: Failed to read scanline 100.
Running tests from gdrivers/envi.py
  TEST: envi_1 ... ERROR 3: Failed to read scanline 0.
  TEST: envi_2 ... ERROR 3: Failed to read scanline 0.
Running tests from gdrivers/genbin.py
  TEST: genbin_1 ... ERROR 3: Failed to read scanline 0.

Attachments (1)

gdal_svn_trunk_report_io_errors_rawrasterband.patch (4.3 KB ) - added by Even Rouault 16 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 by Even Rouault, 16 years ago

Milestone: 1.6.0

Patch commited in r13686. The above tests will fail for the moment.

comment:2 by Even Rouault, 16 years ago

Resolution: fixed
Status: newclosed

Neccesary changes in autotest done by FrankW in later revisions. Closing

Note: See TracTickets for help on using tickets.