Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- C/Database Toolchest Library - name: <b>icopy_db</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Name:       icopy_db

Purpose:    make a copy of a database

Prototype:  int icopy_db(char *old_db_name,char *new_db_name,char *index_name,int blksize);

Header:     isam.h

Inputs:     old_db_name - name of database that is to be copied
            new_db_name - name for new copy of database
            index_name  - index to use or NULL
            blksize     - new block size or 0 for original size

Description:
        icopy_db makes a copy of an existing database.  The original
        database is not modified in any way.  old_db_name is the name
        of the original database that is to be copied.  new_db_name is
        the name for the new copy of the database.  If there is already
        a database by the new name, it is deleted before the original
        database is copied.

        If index_name is not NULL, the records from the original database
        are copied in the order of the specified index.  Otherwise, the
        records are copied in physical order (that is, in the other of the
        Physical Index).  The new database does not contain any deleted
        records or unused space.

        If the blksize is not zero, the index file of the new database
        is created with the specified block size.  Otherwise the new database
        index file is created with the same block size as the old database
        index file.

        If there are many records in the database, icopy_db may take a
        little while.  You can call iprogress to set up a function to
        be called by icopy_db to display a message after each record
        is processed.

Returns:    OK or ERROR

See Also: iprogress

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson