[Gdal-dev] is ogr2ogr returning errorcodes?

Frank Warmerdam warmerdam at pobox.com
Fri Nov 28 14:30:23 EST 2003


Wim Blanken (PI) wrote:
> Hello List,
>  
> A simple question. Is it possible to use ogr2ogr in a batch file and
> get an errorcode back that can be used to check if the conversion
> was a success or not?

Wim,

I tried to return non-zero exit codes from programs such as ogr2ogr in
case of error. Skimming through ogr2ogr.cpp I see that I just return exit
code 1 for all errors, and return 0 on success. So you can't really determine
what went wrong from the error code, but by testing for non-zero values
you can determine if some sort of error occured.

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