HI,<br><br>I want to delete features from a shape file. When i try repack after deleting the features, the .dbf file it self is getting deleted.<br><br>When i trace down the repack function, i could find that in ogrshapelayer.cpp
VSIRename(.....) returns OGRERR_FAILURE.<br><br>/* -------------------------------------------------------------------- */<br>/* Cleanup the old .dbf and rename the new one. */<br>/* -------------------------------------------------------------------- */
<br><br> DBFClose( hDBF );<br> hDBF = hNewDBF;<br><br> VSIUnlink( CPLResetExtension( pszFullName, "dbf" ) );<br> if( VSIRename( oTempFile, CPLResetExtension( pszFullName, "dbf" ) ) != 0 )<br>
return OGRERR_FAILURE;<br> ^^^^^^^^^^^^^^^^^^^^^^^^^^^<br><br><br>Iam calling the delete feature and repack as follows<br>.....<br>poLayer->DeleteFeature(iField)<br>poDS->ExecuteSQL("REPACK myshapefile", NULL, NULL);
<br>......<br><br>Please suggest me some solution.<br><br>Best Regards,<br>N.Vidhiyadharan<br>