Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3825 closed defect (fixed)

ogr2ogr -overwite does not work for shapefiles when file does not exist

Reported by: wbloos Owned by: warmerdam
Priority: normal Milestone: 1.8.0
Component: Utilities Version: 1.7.2
Severity: normal Keywords: ogr2ogr, shapefile, overwrite
Cc:

Description

The command below renders an error in version gdal-bin 1.7.2-4~lucid3

ogr2ogr -f "ESRI Shapefile" -overwrite /var/cache/mapserver/244_2010_wsn_bezoekstippen PG:"host=localhost dbname=dpeep user=upeep password=ppeep" -sql "select * from wsn.vw_punten_per_bezoek where plotid=9643 and jaar=2010" FAILURE: Unable to open existing output datasource `/var/cache/mapserver/244_2010_wsn_bezoekstippen'.

In 1.6.3, the same command does work under the same conditions. Omitting -overwrite solves the problem for 1.7.2 BUT: if you can check if the file exists,with an OS user on the filesystem, you can also delete it. Then the option -overwrite is useless. So i think this can be considered a defect.

cheers, wbl

Change History (3)

comment:1 Changed 9 years ago by wbloos

Keywords: ogr2ogr shapefile overwrite added

comment:2 Changed 9 years ago by Even Rouault

Component: defaultUtilities
Milestone: 1.8.0
Resolution: fixed
Status: newclosed

Fixed in trunk in r21110. Test added in r21112

comment:3 Changed 9 years ago by Even Rouault

Previous fix cleared the bAppend flag, which break some other use cases. Fixed in r21265

Note: See TracTickets for help on using tickets.