Changes critical file mode attributes such as the level of transaction control.
COUNT UpdateFileMode(FILNO filno, COUNT mode)
In V12 the file number typedef was formally changed from COUNT, a two-byte value to FILNO, a four-byte value. Refer to this link for compatibility details. Four Byte File Numbering
When creating or opening a file, the value of filmod sets the attributes for the file. Some of these attributes are permanent, assigned during the creation of the file. Others are temporary, assigned only while the file is open. UpdateFileMode() changes these attributes after the file has been opened or created.
filno specifies the file to be changed. This file must be currently open in ctEXCLUSIVE mode. filmod is the new file mode attribute. It must be perfectly formed, as it will replace the current file mode for this file.
Note: Use this function with caution! It is possible to damage a file if you are not careful. For example, changing a data file from transaction processing to no transaction processing makes automatic recovery unavailable. See the discussion of Transaction File Modes in the FairCom DB Programmer’s Reference Guide.
Some examples of changes that might make sense would be to add or delete ctCHECKLOCK, or to turn on one of the transaction modes for a data file, or to switch between ctPREIMG and ctTRNLOG for an index.
No error occurred.
Cannot switch between fixed and variable-length records.
File must be opened in ctEXCLUSIVE mode to modify.
Cannot switch an index to transaction processing.
See c-tree Error Codes for a complete listing of valid c-tree error values.
printf("\nFile Mode Error %d",uerr_cod);
filno must be opened in an ctEXCLUSIVE mode. No check is made to determine if the change being made will damage the file.