2

I have written a custom external file handler (EXTFH), but there are some cases where I want to revert to the Micro Focus EXTFH. The cases are on a file by file basis (as opposed to a filetype by filetype basis).

My idea is that upon OPEN, I place a marker in the FCD that tells the subsequent operations (READ, WRITE, CLOSE) as to which EXTFH is in use.

My EXTFH has control and the logic can be very simple if there is a place in the FCD that is guaranteed to not be corrupted by MicroFocus.

Is there a place in the FCD (fcd2.h and fcd3.h) that I can mark an open file as being opened by my EXTFH?

My worst case is that I keep a list of the fcd->handle pointers that I have allocated and if I allocated it, then direct to my EXTFH. If not, direct to the MF EXTFH.

Here is the documentation from Micro Focus on EXTFH: http://supportline.microfocus.com/documentation/books/sx20books/fhexfh.htm

That is older documentation, but is appears to be pretty much up-to-date.

[edit to clarify how we will use detect which to use: We will use the extension on the file name to determine which file handler to use. For instance, if the extension is: .xyz, then use our EXTFH, otherwise use MF EXTFH]. It appears we can check the filename on every fileio, but I think it would be cleaner if we just checked upon OPEN. For subsequent calls for that file, we would just check something in the FCD.

Be Kind To New Users
  • 9,672
  • 13
  • 78
  • 125
  • I think this, from the link, means No: "All unused or reserved areas of the FCD must be set to binary zeros." So you are either using the fields in the structure(s) to be meaningful for that CALL, or they are binary zeros, otherwise something unexpected may happen (now or in the future). You'll have to code for it. – Bill Woodger Sep 21 '15 at 23:21
  • Presumably you know when you are writing the code which file-handler you want? You don't sometimes want custom, sometimes default, from one run to another? If so, there's nothing you really need to do if you use a "paragraph/SECTION" approach to files. – Bill Woodger Sep 21 '15 at 23:24
  • Can you show an example of code for an plain input file, please? – Bill Woodger Sep 22 '15 at 06:14

0 Answers0