[gdal-dev] ogr problems with MapInfo

Frank Warmerdam warmerdam at pobox.com
Wed Oct 6 10:07:17 EDT 2010


Daniel Morissette wrote:
> Now, according to http://trac.osgeo.org/gdal/wiki/LargeFileSupport
> GDAL/OGR already enables large file support if your OS supports it .
> Obviously that did not work in this case.

Daniel,

The above topic says that GDAL supports reading large files, it doesn't
necessarily mean that _LARGEFILE_SOURCE is defined.   I *think* I accomplish
reading large files on linux by using a particular 64bit API in
gdal/port/cpl_vsil_unix_stdio_64.cpp though it is a bit unclear exactly
what is getting defined.

On my system I see cpl_conf.h contains "#define UNIX_STDIO_64 1" and:

/* Define to name of 64bit fopen function */
#define VSI_FOPEN64 fopen64

/* Define to name of 64bit fseek func */
#define VSI_FSEEK64 fseeko64

/* Define to name of 64bit ftell func */
#define VSI_FTELL64 ftello64

/* Define to 1, if you have 64 bit STDIO API */
#define VSI_LARGE_API_SUPPORTED 1

/* Define to 1, if you have LARGEFILE64_SOURCE */
/* #undef VSI_NEED_LARGEFILE64_SOURCE */

/* Define to name of 64bit stat function */
#define VSI_STAT64 stat64

/* Define to name of 64bit stat structure */
#define VSI_STAT64_T stat64

It seems to me if VSIStatL() is being used on linux large inode
values shouldn't be a problem.  Perhaps I missing something.  Or
perhaps the MITAB code is using VSIStat() instead?  If so, perhaps
it would suffice to upgrade it to use VSIStatL()?

> Question to Frank and other devs: Is it that a specific configure option
> has to be used to enable large file support, or that the MITAB source
> MUST be updated to use VSIL* calls everywhere?
> 
> (I fear it's the latter, but I thought I'd take a chance anyway)

I think it is the latter.  You should upgrade to use VSI*L everywhere in
MITAB.  This may also be important to allow access to mapinfo files in
non-traditional file systems (like /vsimem/, and the newly popular
/vsicurl/).

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the gdal-dev mailing list