Product Documentation

FairCom DB V12 Release Notes

Previous Topic

Next Topic

ctCopyFile function now opens files in exclusive mode to ensure a clean copy is made

In V11.6 and later, the file copy function, ctCopyFile(), now opens the file in exclusive mode, as documented. Prior to this modification, it opened the file in shared mode, which allowed updates to be made while the file was being copied, causing the copied files to fail to open with error 14.

Behavior Change: This change makes the function's behavior match its documented behavior, which introduces a change in behavior in the field. Previously it was possible to copy a file that was open by another connection and if the file was not updated, the copy of the file would be in good shape. But now the file copy will return an error in this situation.

The following new option for ctCopyFile() provides a way to use the old behavior of opening the file in shared mode. This option indicates the server should try to open the files to copy in shared mode if the files can't be opened in exclusive mode.

To use this option, OR the ctCFallowSharedOpen bit into the cpoptions field of the CPYPRM structure passed to ctCopyFile().

TOCIndex