PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ rt_band_get_file_size()

uint64_t rt_band_get_file_size ( rt_band  band)

Return file size in bytes.

Only for out-db rasters.

Parameters
band: the band
Returns
file size in bytes or 0 in case of error.

Definition at line 586 of file rt_band.c.

586  {
587  VSIStatBufL sStat;
588 
589  assert(NULL != band);
590  if (!band->offline) {
591  rterror("rt_band_get_file_size: Band is not offline");
592  return 0;
593  }
594  /* offline_data is disabled */
595  if (!enable_outdb_rasters) {
596  rterror("rt_band_get_file_size: Access to offline bands disabled");
597  return 0;
598  }
599 
600  if( VSIStatL(band->data.offline.path, &sStat) != 0 ) {
601  rterror("rt_band_get_file_size: Cannot access file");
602  return 0;
603  }
604 
605  return sStat.st_size;
606 }
void rterror(const char *fmt,...)
Wrappers used for reporting errors and info.
Definition: rt_context.c:199
band
Definition: ovdump.py:57
char enable_outdb_rasters
Definition: rt_band.c:417

References ovdump::band, enable_outdb_rasters, and rterror().

Referenced by RASTER_getBandFileSize(), and test_band_metadata().

Here is the call graph for this function:
Here is the caller graph for this function: