It is possible to install or de-install an MFS dynamically by updating a file handle in an BASIC+ program. This technique is useful if programmers wish to add transaction processing, security, or other MFS functionality to a file based on factors that can only be determined at runtime.
If used in reverse – if a program removes an MFS from a file handle – the technique can be used to temporarily bypass a specific MFS for performance or other reasons.
The following sample code illustrates a possible technique for installing an MFS dynamically:
MFS.NAME = "SAMPLE.MFS" OPEN 'SYSTABLES' TO FILE.HANDLE THEN FILE.HANDLE = MFS.NAME : @SVM : FILE.HANDLE END SELECT FILE.HANDLE * processing continues
Note: Because this technique assumes a particular format for the file handle, it may not work for all filing structures. In addition, the structure of file handles may change in future releases of OpenInsight.