BBjFileSystem::convertMKeyedToXKeyed

Description

Converts a MKEYED file into an XKEYED file.

Syntax

Return Value

Method

void

convertMKeyedToXKeyed(string filename, int shouldForceRecoverable)

void convertMKeyedToXKeyed(string filename, int shouldForceRecoverable, string modes)
void convertMKeyedToXKeyed(string filename, int shouldForceRecoverable, string modes, string tmpdir)

Parameters

Variable

Description

filename

Specifies the name of the MKEYED file to be converted.

shouldForceRecoverable

Specifies whether the new XKEYED file will be recoverable.

0 = Non recoverable

1 = Recoverable

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

None.

Remarks

This method requires the full path name for the file to be converted and attempts to create a backup file by adding the extension .bak to the original file name. If a file with this name already exists, the method will generate an !ERROR=12.

Example

rem 'Convert a MKEYED file to an XKEYED file

rem 'Set the file name of the MKEYED file to be converted
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 'Convert the file to the highly recoverable XKEYED format
myFileSystem!.convertMKeyedToXKeyed(FILE_NAME$,myAPI!.TRUE)

ClosedVersion History

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

See Also

BBjAPI

ENCRYPT()

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