Large Files, and other additions

Frank Warmerdam warmerdam at p...
Wed Jan 3 14:13:00 EST 2001


Folks, 

I have added a "large file access API" in cpl_vsi.h. Basically this is
a copy of the normal VSI functions with an L appended. The offset arguments
and return values are of type vsi_l_offset which on some platforms will be
a 64 bit value, and even where not, it will be a 32bit unsigned value. 

On windows I have implemented cpl_vsil_win32.cpp which allows the large
file api to be used to write large files. To be honest, I have only tried
this with files between 2GB and 4GB but it should work with larger files too.

The TIFF and Erdas Imagine readers (internally limited to 4GB) have been
updated to use this API, and I have tested writing and reading >2GB files for
both formats on WinNT. 

Because I have to use underlying Win32 functions to implement the large
file API, the "FILE *" returned by VSIFOpenL() isn't compatible with the
one returned by VSIFOpen(), so the handle for the large file API must be
kept separate from the regular API. The "FILE *" from VSIFOpenL() on 
winnt is a "HANDLE" returned by the Win32 CreateFile() function. 

Because of this compatibility problem, I haven't yet updated all the 
"RawDataset" based formats to support large files. They will have to all be
done at once. 

Note there is also a GIntBig and GUIntBig type, which on some platforms is
64bit. On other platforms (for now, all non-windows) the IntBig is just a
long, and "large file API" is just #define'ed to the regular VSI functions. 

Lastly, I have now implemented support for the popular Netpbm greyscale, and
RGB formats (.pgm and .ppm). This facilitates some experiments I am doing
with the FIASCO (Fractal Image And Sequence COdec) image compressor at:

http://ulli.linuxave.net/fiasco/

Best regards,

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




More information about the Gdal-dev mailing list