Read-only and Shared File Modesc-tree’s interpretation of “opening a file in read-only” mode (ctREADFIL) needs some clarification. When a file is opened with ctREADFIL mode, c-tree enforces the fact that “all-users” (who have this file opened) must be in “read-only” mode, and will not allow the file to be opened if anyone else has it opened for writes or updates. In addition, once you have the file opened with ctREADFIL, no one else can open this file unless they use ctREADFIL. This gives you a way to ensure that no data changes will occur to the file while you have it opened in ctREADFIL mode. This definition sometimes causes confusion for users who what to open the file “read-only” for themselves, say a query program, yet want to allow other programs to continue updating the file. In order to accommodate this situation, support was added in c-tree Plus V7.12 for (ctREADFIL | ctSHARED). Opening a file with both the ctREADFIL mode OR-ed with the ctSHARED mode will protect the opening application from writes (i.e., enforce read-only), while allowing other programs alternate access privileges. Therefore c-tree Plus supports both modes:
An attempt to update data or resources to a file opened in ctREADFIL mode will result in a SWRT_ERR (458). Note: This only applies to client/server and bound server applications. For standalone models, if both ctREADFIL and ctSHARED are turned on, then the ctSHARED is ignored. |
|||