User Tools

Site Tools


tpsfix_command_line_parameters.htm
Navigation:  ISAM File Drivers > TopSpeed File Utilities > TopSpeed Database Recovery Utility >====== TPSFIX Command Line Parameters ====== Previous pageReturn to chapter overviewNext page

The TPSFIX utility can accept command line parameters which lets you execute it from an application, from a Desktop Icon, or from a Windows Shortcut.

Here is the syntax for running TPSFIX noninteractively with command line parameters.

TPSFIX sourcepath[?password] [destpath[?password]] [/E:examplepath[?password]]
[/L:localepath] [/H] [/K] [/P] [/O] [/T:filename]

blk2blue.jpg

TPSFIX The executable (TPSFIX.EXE).
sourcepath The file name and path of the source (damaged) database file.
?password The file's password.
destpath The file name and path of the recovered database file. If omitted, the destpath is the same as the sourcepath and an example file is required.
/A If specified, the user is not offered a backup prompt. The prompt suppressed, however a backup of the file is made.
/E:examplepath The file name and path of the example database file. This parameter is required for any fix-in-place operation (that is, when sourcepath = destpath).
/H- If specified, the utility uses the header information in the source file.
/K If specified, the utility rebuilds all keys for the database.
/L:localepath The file name and path of the Locale (.ENV) file used to specify an alternate collating sequence.
/N If specified, the file will be checked for errors. No errors will be corrected.
/O If specified, the file uses OEMTOANSI and ANSITOOEM to determine the collating sequence.
/P If specified, the user is prompted for each parameter even if they are supplied on the command line.
/T:filename If there are file errors, a log file with the supplied filename will be created.

Using the Recovery Utility Non-Interactively

There are some issues to consider before running the TPSFIX utility. Because of the following, we do not recommend running TPSFIX from your application program. Rather, it is better to instruct your end users to close down the application program completely before running the TPSFIX utility.

·The database file should NOT be open when running TPSFIX. Ensure the file is closed before starting TPSFIX.

·To prevent access during the recovery process is completed, TPSFIX LOCKs the file automatically.

·It is more efficient and safer to have your application rebuild the KEYs (omit the /K parameter). It is also a good way to check the status of a recovery.

Automatic Fix-in-Place Recovery

By omitting the destpath parameter and supplying an example file, you can directly overwrite the damaged file. This is a fix-in-place recovery. The TPSFIX utility does create an intermediate file, but you don't have to worry about it. For Example:

TPSFIX.EXE Datafile.TPS /E:Example.TPE /H

or with Embedded Source Code:

RUN('TPSFIX.EXE Datafile.TPS /E:Example.TPE /H')

This recovers the “datafile.TPS” file using the “Example.TPE” file as an example for the table and key layouts, does not rebuild the keys, and uses the header information in the original file. TPSFIX automatically saves the original file to a backup with a file extension of TP1 through TP9. Each time the utility is executed, the numeric portion of the extension is incremented.

Separate Source and Target Recovery

This method requires two lines of embedded source code but gives you control over the renaming process. You insert the source code in the Accepted Embed point for the Menu Item or button.

Example:

COPY(datafilelabel, 'Datafile.OLD')       !  copies the original file

                    !  to Datafile.OLD

RUN(TPSFIX Datafile.OLD Datafile.tps /H)  !  Runs the utility using the

                    !  renamed file as

                    !  the source and the original

                    !  name as the target

This copies the datafilelabel file to DATAFILE.OLD, recovers the file and writes it to DATAFILE.TPS using the header information in the original file.

tpsfix_command_line_parameters.htm.txt · Last modified: 2021/04/15 15:57 by 127.0.0.1