[Gdal-dev] GDALOpenInfo->fp == NULL for large files?

Frank Warmerdam warmerdam at pobox.com
Tue Mar 13 01:05:49 EDT 2007


Nick Bower wrote:
> Hi - thanks Frank, but I did mention in my original post that the file
> is just 85 megabytes big.  The platform is a HPC style Itanium cluster
> running SuSe by the way.  Commenting out the fp = NULL in the block in
> which VSIFOpenL happens makes things work, including the L1B driver's
> use of VSIFOpen.  But the real issue would seem to be why is errno being
> set by VSIFOpen?  I may be a Python coder, but what guarantees that
> fp!=NULL && errno != (27, ENOENT, 79) simultaneously?  Convention
> (whatever I'm doing, I seem to be breaking it)?  Perhaps the logic here
> needs to be better.
> 
>             fp = VSIFOpen( pszFilename, "rb" );
>             if( fp != NULL )
>             {
>                 nHeaderBytes = (int) VSIFRead( pabyHeader, 1, 1024, fp
>                 );
>                 VSIRewind( fp );
>             }
>             else if( errno == 27 /* "File to large" */
>                      || errno == ENOENT
>                      || errno == 79 /* EOVERFLOW - value too large */ )
>             {
>                 // Why are we in here if VSIFOpen works elsewhere???
>                 ....
> 

Nick,

Sorry, that is what I get for reading quickly and leaping to assumptions.

I'm left quite confused.  Are you suggesting that in the above context
fp is return as non-NULL by VSIFOpen(), but we end up in the errno==27
logic anyways?  That doesn't seem to make sense.

I'm at a loss.

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    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list