BBjFileSystem::recoverFile

Description

Rebuilds any recoverable file type based on the internal recovery information contained within the file. This includes MKEYED, XKEYED, and VKEYED file types.

Syntax

Return Value

Method

BBjRecoverFileStatus recoverFile(string filename)
BBjRecoverFileStatus recoverFile(string filename, string modes)
BBjRecoverFileStatus recoverFile(string filename, string modes, string tmpdir)

Parameters

Variable

Description

filename

Specifies the name of the file to be recovered.

modes Mode string to use for opening the original file and creating the new file. Notably, this is where "CRYPTPASS" could be specified for an encrypted file.
tmpdir Temporary directory to use for the conversion temporary file. If not specified, it defaults to the same directory as the original file. Prior to 24.01, the default was the Java global temporary directory.

Return Value

If the file recovery is successful, this returns a BBjRecoverFileStatus object with information about the file recovery.

Example

rem 'Recover an MKEYED/XKEYED file

rem 'Set the file name of the XKEYED file to be recovered
FILE_NAME$="C:\TEST\CUSTOMER.DAT"

rem 'Obtain the instance to the BBjAPI object
myAPI! = BBJAPI()

rem 'Obtain the instance to the BBjFileSystem object
myFileSystem! = myAPI!.getFileSystem()

rem 'Recover the XKEYED file
status! = myFileSystem!.recoverFile(FILE_NAME$)

ClosedVersion History

  • BBj 24.01: Added an optional tmpdir argument.
  • BBj 24.00: Added an optional modes argument.

See Also

BBjAPI

BBjRecoverFileStatus

ENCRYPT()

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.