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>/*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Cleanup the old .dbf and rename the new one.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */<br>/* -------------------------------------------------------------------- */
<br><br>&nbsp;&nbsp;&nbsp; DBFClose( hDBF );<br>&nbsp;&nbsp;&nbsp; hDBF = hNewDBF;<br><br>&nbsp;&nbsp;&nbsp; VSIUnlink( CPLResetExtension( pszFullName, &quot;dbf&quot; ) );<br>&nbsp;&nbsp;&nbsp; if( VSIRename( oTempFile, CPLResetExtension( pszFullName, &quot;dbf&quot; ) ) != 0 )<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return OGRERR_FAILURE;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ^^^^^^^^^^^^^^^^^^^^^^^^^^^<br><br><br>Iam calling the delete feature and repack as follows<br>.....<br>poLayer-&gt;DeleteFeature(iField)<br>poDS-&gt;ExecuteSQL(&quot;REPACK myshapefile&quot;, NULL, NULL);
<br>......<br><br>Please suggest me some solution.<br><br>Best Regards,<br>N.Vidhiyadharan<br>