Ramiro,<br><br>You can use the OGRLayer::TestCapability() method to check write capability of a layer. However, there are going to be errors if another process accesses the files in the mean while.<br><br>When ogr2ogr is executed with -append, -overwrite or --update options, it should error out with the message &quot;Unable to open existing output datasource&quot; if a file cannot be opened to write. Can you raise a new ticket [1] describing this problem?<br>
<br>[1]: <a href="http://trac.osgeo.org/gdal/newticket">http://trac.osgeo.org/gdal/newticket</a><br><br><div class="gmail_quote">On Wed, May 25, 2011 at 12:20 AM, Ramiro Gonzalez <span dir="ltr">&lt;<a href="mailto:ramirogonzalez@suremptec.com.ar">ramirogonzalez@suremptec.com.ar</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">hello<br>
<br>I want to overwrite a shapefile using ogr(c++). If the dbf file in the destination shapefile is already open by anather program(exel), the operation fails in the middle and only the shp and shx files are updated.<br>

How could I check, using OGR, if the dbf(or any other file in the shapefile) is blocked before I overwrite it? <br><br>I tested this with &quot;ogr2ogr -overwrite destination source.shp&quot; and the same thing happens <br>


<br>
Thanks,<br><font color="#888888">
Ramiro
</font><br>_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br></blockquote></div><br><br clear="all"><br>-- <br>Best regards,<br>Chaitanya kumar CH.<br>
/tʃaɪθənjə/ /kʊmɑr/ <br>+91-9494447584<br>17.2416N 80.1426E<br>