Opened 17 years ago

Last modified 14 years ago

#1521 closed defect (fixed)

Delete feature - .dbf file getting deleted — at Initial Version

Reported by: vdharan2001@… Owned by: Mateusz Łoskot
Priority: highest Milestone:
Component: OGR_SF Version: 1.7.1
Severity: critical Keywords:
Cc:

Description

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.

When i trace down the repack function, i could find that in ogrshapelayer.cpp VSIRename(.....) returns OGRERR_FAILURE.

/* -------------------------------------------------------------------- */
/*      Cleanup the old .dbf and rename the new one.                    */
/* -------------------------------------------------------------------- */

    DBFClose( hDBF );
    hDBF = hNewDBF;

    VSIUnlink( CPLResetExtension( pszFullName, "dbf" ) );
    if( VSIRename( oTempFile, CPLResetExtension( pszFullName, "dbf" ) ) != 0 )
        return OGRERR_FAILURE;
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^


Iam calling the delete feature and repack as follows
.....
poLayer->DeleteFeature(iField)
poDS->ExecuteSQL("REPACK myshapefile", NULL, NULL);

-------------

Change History (0)

Note: See TracTickets for help on using tickets.